Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6654317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:22:34+00:00 2026-05-26T01:22:34+00:00

I need to know how to read data from tabbed delimited text file in

  • 0

I need to know how to read data from tabbed delimited text file in order to export merged documents to correct location.

— will always be 4th tab 2nd row (group number) directory will be named by group number

— have directories already created by privious .vbs script

data will have to be placed:

app.open(File(dirPath + "Card~" + (group number) + ".indd"));   

and also:

fileName = (group number) + " " + myPageName + " " + date + ".pdf";        
        myFilePath = dirPath + docType + "/" + fileName;
        myFile = new File(myFilePath);
        myDocument.exportFile(ExportFormat.pdfType, myFile, false);

within previous .vbs script to work with this data file was written as so:

    Call TwoDimensionArrayTest
Sub TwoDimensionArrayTest

Dim fso
    Dim oFile
    Dim arrline
    Dim arrItem
    Dim i
    Dim arrMain()
    Dim sFileLocation, strResults
    Dim filesys, folder, path 

    Const forReading = 1
    
strFolder = "P:\RxCut\In Design Implementation\build\Co-Brand\"
mkdir = "P:\RxCut\In Design Implementation\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
For Each objFile In objFSO.GetFolder(strFolder).Files
    If Right(LCase(objFile.Name), 4) = LCase(".txt") Then
    
        ' The file contains on each line:
    ' Text1 (tab) Text2 (tab) Text3 (tab) Text4
    ' Text5 (tab) Text6 (tab) Text7 (tab) Text8
'etc etc

Set fso = CreateObject("Scripting.FileSystemObject")
        sFileLocation = objFile.Name
        
        Set oFile = fso.OpenTextFile(objFile.Name, forReading, False)
        
    Do While oFile.AtEndOfStream <> True
        strResults = oFile.ReadAll
    Loop
    
    ' Close the file
    oFile.Close
    
' Release the object from memory
    Set oFile = Nothing
    
' Return the contents of the file if not Empty
    If Trim(strResults) <> "" Then
        
        ' Create an Array of the Text File
        arrline = Split(strResults, vbNewLine)
    End If
 
    For i = 0 To UBound(arrline)
        If arrline(i) = "" Then
            ' checks for a blank line at the end of stream
            Exit For
        End If 
        
        ReDim Preserve arrMain(i)
        
            arrMain(i) = Split(arrline(i), vbTab)

    Next
    
    path = arrMain(1)(3)
    dir = mkdir & path
    set filesys=CreateObject("Scripting.FileSystemObject") 
If Not filesys.FolderExists(dir) Then 
Set folder = filesys.CreateFolder(dir) 
End If
    
   dir = mkdir & path
   Set folder = filesys.CreateFolder(dir & "\Web")
   Set folder = filesys.CreateFolder(dir & "\Web\Web Cards")
   Set folder = filesys.CreateFolder(dir & "\Web\Web Headers")
   
       fso.MoveFile sFileLocation, arrMain(1)(3) & ".txt"
       
 End If 
 Next
End Sub ' TwoDimensionArrayTest

How can I achieve something similar in .jsx?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:22:35+00:00Added an answer on May 26, 2026 at 1:22 am

    Figured it out this will read 1,3 and create a variable for group number 1,3

     var aFile = File("P:/RxCut/In Design Implementation/build/automate/automate.txt");
        var fileData = readTabDelimitedFile ( aFile ) ;
        //$.writeln(fileData[1][3]); //should contain first tab on second line
        tstdata = fileData[1][3];
        var group = tsdata
        function readTabDelimitedFile ( fPath ) {
    
        var returnArray = new Array ( ) ;
    
        //-- Verify that the file exists
        var fileObject = File ( fPath ) ;
        if ( ! fileObject.exists ) {
        return returnArray ; // an empty array because the file doesn't exist.
        }
        //-- Create a regular expression for a tab.
        var tabExpression = new RegExp ( '\\t' ) ;
    
        //-- Read the file.
        try {
        //-- The file has to be open.
        fileObject.open ('r') ; //-- Open for reading.
    
        while ( ! fileObject.eof ) {
        var currentLine = fileObject.readln () ;
    
        if ( tabExpression.test( currentLine ) ) {
    
        returnArray.push(currentLine.split ('\t')) ;
        }
        }
        fileObject.close() ;
        }
    
        catch (errMain) {
        try {
    
        fileObject.close() ;
        }
        //-- if the close generates an error skip it.
        catch (errInner ) { /* nothing here */ }
        }
    
        return returnArray ;
    
        var group = returnArray 
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to read a large (2000x2000) matrix of binary data from a file
I need to read a file in PHP, but I only know the end
I am new to C, and want to read some data from a file.
I need to read data from barcode scanner in a web page. I agree
I need raw read data from and write data into drive..not via existed filesystem
I'm reading binary data from a file, specifically from a zip file. (To know
I need to read data from an online database that's displayed using an aspx
In the uncompressed situation I know I need to read the wav header, pull
I need to know, from within Powershell, if the current drive is a mapped
my C# application reads data from special USB device. The data are read as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.