Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Tab Delimited File

New Here ,
Apr 19, 2023 Apr 19, 2023

I have a tab delimited file that was created from MS Excel.  This tab delimited file has a number of rows and I am wanting to know how many rows are in this file utilizing javascript.  Any sugesstions would be greatful.  Thank you in advance.

TOPICS
JavaScript
989
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2023 Apr 20, 2023

What do you mean? A text file can't "utilize" JavaScript. It can contain JS code, but that's not executed unless the file is loaded into some other application. Also, it would be very difficult to identify such a thing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2023 Apr 20, 2023

Sorry, I think I misunderstood what you meant... You want to use JS to know how many lines are in the file, right?

If so, you can use the readFileIntoStream method of the util object and then parse it as a string to find that out.

One way would be to split it by new-line characters (either "\n" or "\r\n", depending on the encoding), and then check the length of the resulting array.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 20, 2023 Apr 20, 2023
LATEST

Thank you for you repsonse, I will look into what you have suggested.  Is there a way to move to the beginning (first column) of the last line of the tab delimited file?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines