String Manipulation To Get An Item In The Middle Of A CSV File

Nick LaMarca

I have a csv file I need to parse and get an item out of the middle of it. I have chose string manipulation to do this.

sample input file data would be..

Nick,frog,snake,1234

I can get the last entry "1234" with this code..

 line.Substring(line.LastIndexOf(",") + 1)

How would I get the 3rd entry, "snake", with substrings? (what the OP means is: how can I get the third element in the comma-separated string, which happens to be "snake")

helrich

If you've stored the text of your file in myInputText, and you want to access the third item, the following will work:

resultString = Strings.Split(myInputText, ",")(2)

You can access any string in the file this way.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Appending string in the middle of a text file

From Dev

php regex to get middle of string

From Dev

Python URL get middle string

From Dev

PHP get middle of text file

From Dev

CSV file trying to get item after first comma in each row

From Dev

Batch File file output, string manipulation

From Dev

perl regex CSV file and column header manipulation

From Dev

Issues with .JSON file conversion and CSV manipulation in Python

From Dev

How to get filelist and use the filename as input for string manipulation (duplicate checking) & condition using batch file?

From Dev

Pandas CSV file with occasional extra columns in the middle

From Dev

Read in csv file with one column of strings in the middle

From Dev

String manipulation by specific delimiter and write in text file

From Dev

String manipulation by specific delimiter and write in text file

From Dev

Manipulation of string array to get +1 at end

From Dev

String manipulation - get part after a certain word

From Dev

How to get a certain string in the middle of a my text

From Dev

String Split in JavaScript and get the middle data

From Dev

String Manipulation

From Dev

Convert .csv file for further manipulation using 'highfrequency' package on R

From Dev

bash - string manipulation get string before or after substring

From Dev

Remove specific line in a csv file defined by the string in selected item in listbox - winforms c#

From Dev

Replace a middle string in .bat file using AutoHotKey without deleting file

From Dev

Get storage item as a string and not an object

From Dev

Bash string manipulation works differently in shell than .sh file?

From Dev

Powershell - String Manipulation - getting dir from full file-path

From Dev

String manipulation in java to get previous characters of a particular character

From Dev

String manipulation in java to get previous characters of a particular character

From Dev

Jquery AJAX ($.get or $.ajax) HTML File retrieval, Manipulation, and JSON Send

From Dev

How to parse a CSV file if the column I want to Parse is in the middle of the CSV file in Python?

Related Related

  1. 1

    Appending string in the middle of a text file

  2. 2

    php regex to get middle of string

  3. 3

    Python URL get middle string

  4. 4

    PHP get middle of text file

  5. 5

    CSV file trying to get item after first comma in each row

  6. 6

    Batch File file output, string manipulation

  7. 7

    perl regex CSV file and column header manipulation

  8. 8

    Issues with .JSON file conversion and CSV manipulation in Python

  9. 9

    How to get filelist and use the filename as input for string manipulation (duplicate checking) & condition using batch file?

  10. 10

    Pandas CSV file with occasional extra columns in the middle

  11. 11

    Read in csv file with one column of strings in the middle

  12. 12

    String manipulation by specific delimiter and write in text file

  13. 13

    String manipulation by specific delimiter and write in text file

  14. 14

    Manipulation of string array to get +1 at end

  15. 15

    String manipulation - get part after a certain word

  16. 16

    How to get a certain string in the middle of a my text

  17. 17

    String Split in JavaScript and get the middle data

  18. 18

    String Manipulation

  19. 19

    Convert .csv file for further manipulation using 'highfrequency' package on R

  20. 20

    bash - string manipulation get string before or after substring

  21. 21

    Remove specific line in a csv file defined by the string in selected item in listbox - winforms c#

  22. 22

    Replace a middle string in .bat file using AutoHotKey without deleting file

  23. 23

    Get storage item as a string and not an object

  24. 24

    Bash string manipulation works differently in shell than .sh file?

  25. 25

    Powershell - String Manipulation - getting dir from full file-path

  26. 26

    String manipulation in java to get previous characters of a particular character

  27. 27

    String manipulation in java to get previous characters of a particular character

  28. 28

    Jquery AJAX ($.get or $.ajax) HTML File retrieval, Manipulation, and JSON Send

  29. 29

    How to parse a CSV file if the column I want to Parse is in the middle of the CSV file in Python?

HotTag

Archive