How to add name from text file to jtable?

hello all,
how to add name (string) from the notepad file(.txt) into jTable rows.
I am not able to add it.
try {
             FileInputStream fis = new FileInputStream("Devices/Devices_Lst.txt");
             BufferedReader br = new BufferedReader(new InputStreamReader(fis));
             String line = null;
             Vector data = new Vector();
             line = br.readLine();
             while ( (line = br.readLine()) != null)
                int rowCount1 = nmsTable.getRowCount();
                for(int i=0;i<rowCount1;i++)      
                    myTableInit();  // it initialize the table
                   /* nmsTable.setValueAt(i+1,i,0);
                    Table.setValueAt(line,i,1);
                    Table.setValueAt(" ",i,2);
                    Table.setValueAt(" ",i,3);
                    Table.setValueAt(" ",i,4);
                    Table.setValueAt(" ",i,5); */
                    int rowNo = nmsTable.getRowCount();
                    row.addElement((rowNo+1));
                       //row.addElement(ipText.getText()+"-"+nameText.getText());
                       row.addElement(line);   
                       row.addElement((String)" ");
                       row.addElement((String) "");
                       row.addElement((String) "");
                       row.addElement((String) "");      
                        row.addElement((String) "");      
                        rows.add(row);                                     //rows is the Vector for table row.
                        Table.addNotify(); 
              br.close();
             if possible give me some examples.
thank you.

For every row you need to create a new Vector and add the data to that Vector. Then the Vector is added to the TableModel.
If you add 6 items to the single Vector, then you will get 6 columns. So you need to create 6 Vectors and add a single item to each Vector and therefore you will end up with 6 rows with 1 column of data.

Similar Messages

  • How to create PDF from text file with specific layout?

    I wanted to create the pdf from text file in specific layout - Landscape orientation and JIS B3 Page size while at Adobe Acrobat Pro.
    In past, I could do a right click on a text file (desktop area) and select print to print out the document into .pdf BUT only if I set the Adobe PDF to Landscape and JIS B3 Page size BEFORE.  And I could only do 15 text documents at once.
    I wanted to see if I could do the create the pdf from text file with specific layout in Adobe Acrobat without having to go to Control Panel to preset the Adobe PDF to specific layout at every time.   I would have to set Adobe PDF back to normal layout after I'm done with these pdf print outs.  I do lots of pdfs in normal layout.  Sometimes I would forget to do that.
    So, How do I do that?

    No such luck.  It would output the contents in letter size even in JIS B3 Page layout at MS word. 
    Is there a script or action where I could set the orientation and page size before creating PDF on these text files?

  • How to save data from text file in databse for a transaction...

    Hi Guys,
    I have a text file which has some data related relevant to transaction VA01 separated by tabs.
    Now instead of going in the transaction in VA01 and thne feeding the data manually, I would like this data
    to get read automatically from the text file and get processed field by field for transaction VA01 and thne get saved.
    How do I achieve this ? Do I have to use SHDB or some other method ?a

    hi tushar,
    REPORT  ZCALL_TRANS_TAB1                      .
    TABLES: LFA1,LFBK,lfb1.
    *& internal table declaration
    data: BEGIN OF it_vendor occurs 0,
           LIFNR LIKE LFA1-LIFNR,
           bukrs like lfb1-bukrs,
           END OF it_vendor.
    DATA: BEGIN OF IT_BANK occurs 0,
          LIFNR LIKE LFA1-LIFNR,
          BANKS LIKE LFBK-BANKS,
          BANKL LIKE LFBK-BANKL,
          BANKN LIKE LFBK-BANKN,
          koinh like lfbk-koinh,
          END OF IT_BANK.
    data: it_bdcdata like bdcdata occurs 0 with header line.
    data: it_messages like bdcmsgcoll occurs 0 with header line.
    *selection screen.
    selection-screen: begin of block b1 with frame.
    parameters: p_file like rlgrap-filename default 'c:/vendor.txt'
    obligatory.
    parameters: p_file1 like rlgrap-filename default 'c:/xyz.txt'
    obligatory.
    selection-screen: end of block b1.
    *at selection screen.
    at selection-screen on value-request for p_file.
    perform f4_help using p_file.
    at selection-screen on value-request for p_file1.
    perform f4_help1 using p_file1.
    *start of selection
    start-of-selection.
    *******uploading file
    perform upload_file using p_file P_FILE1.
    ******open session.
    perform populate_data.
    *&      Form  f4_help
          text
         -->P_P_FILE  text
    form f4_help  using    p_p_file.
    data: l_file type ibipparms-path.
    call function 'F4_FILENAME'
    importing
       file_name           = l_file.
       p_file = l_file.
    endform.                    " f4_help
    *&      Form  POPULATE_DATA
          text
    -->  p1        text
    <--  p2        text
    form populate_data .
    DATA: L_STRING TYPE STRing.
    DATA: L_COUNTER(2) TYPE n.
    loop at it_vendor.
    perform bdc_dynpro      using 'SAPMF02K' '0106'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-D0130'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                   it_vendor-lifnr.
    perform bdc_field       using 'RF02K-BUKRS'
                                  it_vendor-bukrs.
    perform bdc_field       using 'RF02K-D0130'
                                  'X'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-bankn(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPDA'.
    ******CALL TRANSACTION.
    call transaction 'FK02' using it_bdcdata mode 'A'
                            messages into it_messages.
    write:/ sy-subrc.
    perform format_messages.
    clear it_bdcdata.
    refresh it_bdcdata.
    endloop.
    endform.                    " POPULATE_DATA
    *&      Form  FORMAT_MESSAGES
          text
    -->  p1        text
    <--  p2        text
    form format_messages .
    data: l_msg(100).
    loop at it_messages.
    call function 'FORMAT_MESSAGE'
    exporting
       id              = it_messages-msgid
       lang            = sy-langu
       no              = it_messages-msgnr
       v1              = it_messages-msgv1
       v2              = it_messages-msgv2
       v3              = it_messages-msgv3
       v4              = it_messages-msgv4
    importing
       msg             = l_msg
    exceptions
       not_found       = 1
       others          = 2
    write:/ l_msg.
      endloop.
    endform.                    " FORMAT_MESSAGES
    *&      Form  bdc_dynpro
          text
         -->P_0173   text
         -->P_0174   text
    form bdc_dynpro  using    value(p_program)
                              value(p_screen).
    it_bdcdata-program = p_program.
    it_bdcdata-dynpro = p_screen.
    it_bdcdata-dynbegin = 'X'.
    append it_bdcdata.
    clear it_bdcdata.
    endform.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0178   text
         -->P_0179   text
    form bdc_field  using    value(p_fnam)
                             value(p_fval).
    it_bdcdata-fnam = p_fnam.
    it_bdcdata-fval = p_fval.
    append it_bdcdata.
    clear it_bdcdata.
    endform.                    " bdc_field
    *&      Form  upload_file
          text
         -->P_P_FILE  text
         -->P_P_FILE1  text
    form upload_file  using    p_p_file
                               p_p_file1.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = P_P_FILE
       FILETYPE                      = 'DAT'
      HEADLEN                       = ' '
      LINE_EXIT                     = ' '
      TRUNCLEN                      = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      DAT_D_FORMAT                  = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        data_tab                      = IT_VENDOR
    EXCEPTIONS
      CONVERSION_ERROR              = 1
      FILE_OPEN_ERROR               = 2
      FILE_READ_ERROR               = 3
      INVALID_TYPE                  = 4
      NO_BATCH                      = 5
      UNKNOWN_ERROR                 = 6
      INVALID_TABLE_WIDTH           = 7
      GUI_REFUSE_FILETRANSFER       = 8
      CUSTOMER_ERROR                = 9
      NO_AUTHORITY                  = 10
      OTHERS                        = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    *******UPLOADING BANK DETAILS
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      CODEPAGE                      = ' '
       FILENAME                      = P_P_FILE1
       FILETYPE                      = 'DAT'
      HEADLEN                       = ' '
      LINE_EXIT                     = ' '
      TRUNCLEN                      = ' '
      USER_FORM                     = ' '
      USER_PROG                     = ' '
      DAT_D_FORMAT                  = ' '
    IMPORTING
      FILELENGTH                    =
      TABLES
        data_tab                      = IT_BANK
    EXCEPTIONS
       CONVERSION_ERROR              = 1
       FILE_OPEN_ERROR               = 2
       FILE_READ_ERROR               = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 10
       OTHERS                        = 11
    IF sy-subrc <> 0.
    MESSAGE I000(ZZ) WITH 'UNABLE TO UPLOAD'.
    STOP.
    ENDIF.
    endform.                    " upload_file
    *&      Form  f4_help1
    form f4_help1  using    p_p_file1.
    data:l_file1 type ibipparms-path.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
       FILE_NAME           = l_file1.
       p_file1 = l_file1.
    endform.                    " f4_help1

  • How to extract data from  text file to database table

    Hi ,
    I am trying to upload  data in text file to database table  using GUI_UPLOAD function .what would be the program for that.
    thanks in advance.

    Hi,
    I don't think you have a standard sap program to upload data from file to database table...
    Instead you can create a custom program like this..
    DATA: T_FILEDATA(1000) OCCURS 0 WITH HEADER LINE.
    DATA: T_ZTABLE LIKE ZTABLE OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = 'C:\TEST.TXT'
      tables
        data_tab                      = T_FILEDATA
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT T_FILEDATA.
      T_ZTABLE = T_FILEDATA.
      APPEND T_ZTABLE.
    ENDLOOP.
    MODIFY ZTABLE FROM TABLE T_ZTABLE.
    COMMIT WORK..
    Thanks,
    Naren

  • How to add bookmarks from .xml file?

    I switched from a PC to an iMac and i'm trying to set up the Safari browser. I was using MSN explorer as my default. I saved the .xml file where all my bookmarks were stored. Is there a way I can import the .xml file so all my bookmarks can load?

    hi,
    check out the following links
    Check this blog to extract from XML:
    /people/kamaljeet.kharbanda/blog/2005/09/16/xi-bi-integration
    http://help.sap.com/saphelp_nw04/helpdata/en/fe/65d03b3f34d172e10000000a11402f/frameset.htm
    Check thi link for Extract from any DB:
    http://help.sap.com/saphelp_nw04s/helpdata/en/58/54f9c1562d104c9465dabd816f3f24/content.htm
    regards
    harikrishna N

  • How to put data (from texte file) in the Tab

    Hi,
    I have a file with one line data.
    I want to put the data in a tab with 5 colums and x line.
    I attach a example.
    Thank's
    Attachments:
    ni-help.zip ‏9 KB

    You need to modify the input parameters in the Spreadsheet Sheet String to Array. For the delimeter, you need to specify a space. By default, the function uses a tab as a delimiter.

  • VB Script to accept PC names in text file and get registry key value out of those systems

    Hi All,
    My task: Create VB script to accept PC names from a text file, process each host name to get Registry key value of individual host name and finally export them to a text file or an excel sheet having registry key value against each pc.
    I want to pull key value of LSFORCEHOST located in HKCU/Environment of each PC and export this value against each pc in a text or Excel file.
    What I achieved: I am able to process against single pc name but failed to process 3000+ systems listed in a text file which I tried to process through VB script. I am not pro and learning the VBS and cant write complex code.
    My VBS code written so far(It failed many time with issue):
     Option Explicit
     Const HKEY_CURRENT_USER = &H80000001
     Dim oFSO, sFile, oFile, sText, strComputer,oReg, strKeyPath, strValueName, strValue, objFSO, objFile, strContents
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     sFile = "test.txt"
     If oFSO.FileExists(sFile) Then
      Set oFile = oFSO.OpenTextFile(sFile, 1)
       Do While Not oFile.AtEndOfStream
        sText = oFile.ReadLine
         If Trim(sText) <> "" Then
    strComputer = sText
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
        strComputer & "\root\default:StdRegProv")
    strKeyPath = "Environment"
    strValueName = "LSFORCEHOST"
    oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
    Const ForReading = 1
    Const ForWriting = 2
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile("C:\destination.txt",1, ForReading)
    strContents = strValue
    Set objFile = objFSO.OpenTextFile("C:\destination.txt",2, ForWriting)
    objFile.Write strContents
    objFile.Close
    End If
    Loop
    oFile.Close
    End If
    I think when I tried to process each PC name from text file against registry key value, above code not working. As per my knowledge some issue in loop. Do I need to add FOR EACH feature? 
    Please help to correct it. Thanks in advance.

    I think when I tried to process each PC name from text file against registry key value, above code not working. As per my knowledge some issue in loop. Do I need to add FOR EACH feature? 
    Please help to correct it. Thanks in advance.
    Your code contains numerous errors. Furthermore you make things difficult for yourself by giving similar names to the objects used for your input and output. If you are a systems administrator then your best bet is to make an effort to learn the language
    instead of grabbing a few code fragments from here and there and hoping that somehow they will work.
    Try the cleaned up code below for this particular project. Note the consistent code indentation. It helps you enormously when trying to understand the structure of the code. Remember also that you must fully qualify all file paths. Writing to "Destination.txt"
    will cause endless confusion because you never know for sure where this file will reside.
     Const HKEY_CURRENT_USER = &H80000001
     Set oFSO = CreateObject("Scripting.FileSystemObject")
     sKeyPath = "Environment"
     sValueName = "LSFORCEHOST"
     sFile = "D:\Test.txt"
     If oFSO.FileExists(sFile) Then
       Set oInput = oFSO.OpenTextFile(sFile, 1)
       Do While Not oInput.AtEndOfStream
         sComputer = oInput.ReadLine
         If Trim(sComputer) <> "" Then
           Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
             & sComputer & "\root\default:StdRegProv")
           oReg.GetStringValue HKEY_CURRENT_USER,sKeyPath,sValueName,sValue
           Set oOutput = oFSO.OpenTextFile("D:\destination.txt",8, True)
           oOutput.WriteLine sValue
           oOutput.Close
        End If
      Loop
      oInput.Close
    End If

  • How do I get a text file from Photoshop  to work in the main sequence in pp?

    How do I get a text file to work properly in the master sequence. I moved it from Photoshop, which I learned to do from a tutorial, but when I move the animated text sequence to the master, it either isnt running, or it is scaled way too big. How do I get it to run in the main sequence?

    "Wont Work Here" !  Does not mean much.
    Are you having an audio or a video issue? 
    Looks like no video clip on the video layer above that section of audio.
    I am teaching myself this stuff completely on the fly
    I suggest you do the Basic Tutorials ( Adobe TV for example) in both Premiere Pro and PhotoShop.
    You need to be competent in the basics and fundamentals of these apps and that will also help you describe and discuss the issues.   Check the 'Products on this site....
    Adobe TV

  • How to open saved files using 'read from text file' function

    Hi everyone, I am having a hard time trying to solve the this particular problem ( probably because I am a newb to lanbview ). Anyway , I am able to save the acquired waveforms by using the 'Write to text file' icon. I did manually modify the block diagram of the 'Write to text file' icon and create the correct number of connector so as to make my program work. But now I have no idea on how to modify the block diagram of the 'Read from text file' block diagram to make my program 'open' my saved waveforms. Or i do not have to modify anything from the block diagram of the 'Read from text file'? Can anyone teach/help me connect up? Do i need the build array on the "open" page?
    Here are some screenshots on part of my program  
    let me know if you guys would need more information / screenshots thank you!
    Attachments:
    ss_save.jpg ‏94 KB
    ss_open.jpg ‏94 KB
    modified_writetotextfile.jpg ‏99 KB

    Ohmy, thanks altenbach. oh yeah i forgot about those sub VIs. will upload them now. Was rather demoralized after reading the comments and really struck me on how weak i'm at on labview really hope to get this done. But of course i have to study through and see how it works. Actually i am going to replace those 'signal generators sub vi' with ThoughtTechonology's sample code so i can obtain data waveforms real-time using Electrocardiography (ECG) ,Electromyography (EMG ) and Electroencephalography (EEG) hopefully i can find out how to connect the sample code.
    ( ps . cant connect it now unless my program is working otherwise labview will crash ) 
    ( p.s.s the encoder of my biofeedback trainer already acts as an DAQ so i wont need to place an DAQ assistant in my block diagram i suppose )
    The sample code of ThoughtTechnology is named as attachment.ashx.vi. too bad i cant use it and present it as my project
    Attachments:
    frequency detactor.vi ‏53 KB
    signal generator.vi ‏13 KB
    attachment.ashx.vi ‏40 KB

  • How can we read a column from text file

    hai,
    the Text file contains :
    m1 m2 m4 89
    m1 m2 m4 89
    m0 m4 m2 90
    I need one array for each column
    m[0]= m1,m1,m0 (first column from text file)
    m[1]= m2,m2,m2 (second column from text file)
    m[2]= 89,89,90 (third column from text file)
    andvance thanks

    If a 2D array is OK (instead of 4 separate arrays), try something like this
    import java.io.*;
    import java.util.ArrayList;
    class FileReadColumns
      public static void main(String args[]) throws IOException, FileNotFoundException
        String line;
        ArrayList lines = new ArrayList();
        BufferedReader in = new BufferedReader(new FileReader("data.txt"));
        while ((line = in.readLine()) != null) lines.add(line);
        String bits[];
        bits = lines.get(0).toString().split(" ");
        String grid[][] = new String[bits.length][];
        for(int i=0;i<grid.length;i++)grid[i] = new String[lines.size()];
        for(int i = 0; i < lines.size(); i++)
          bits = lines.get(i).toString().split(" ");
          for(int ii = 0; ii < bits.length; ii++) grid[ii] = bits[ii];
    for(int i = 0; i < grid.length; i++)
    for(int ii=0;ii<grid[i].length;ii++)System.out.print(grid[i][ii]+" ");
    System.out.println();
    System.exit(0);

  • How to exclude schema name from exported files (PL SQL Developer)

    Dear all,
    Just one question: I am using PL SQL Developer. My goal is to export some data (as .sql and .dmp files) from one database and to import them into the another database (both databases have identical structure - test database and production, just different database names and names of schema. In order to make it possible, I need to exclude schema name from generated export file. I believe that it is possible to do it automatically by setting up parameters of PL SQL Developer. How?
    Thank you in advance,
    Kindest regards,
    Dragana

    In the meantime, I have found the answer on my previous question:
    Actually, the initial idea (how to exclude schema name from exported files) was wrong. No need for any intervention.
    Trick is: Schema name can be changed during the import of exported files (PL SQL Developer during import gives possibility: From User (old schema) To User (new schema) .
    Hope that this will be useful info for others.
    Dragana

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • How to find largest number from text file

    I am using the "Read from text file" block to read the data from my .txt file into labview.  It is now in string format.  I have many numbers in the file.  
    For example:
    0.45
    0.35
    0.12
    1.354
    1.56
    2.89
    5.89
    0.56
    That is what a text file might look like.  I want to find which of these numbers is largest, and do calculations with that number.  I am having trouble with strings/number formats/arrays, etc.  Thanks
    Solved!
    Go to Solution.

    The spreadsheet functions and VIs typically work on strings representing numbers separated by delimiters.  This is a typical way to save a "spreadsheet" (of numbers) to a text file, for example .csv files.  These are quite versatile and powerful functions.  Spend a bit of time becoming familiar with them because you may find yourself using them a lot.
    Lynn

  • Power Shell - Read from text file

    Looking to see how to output select data from c:\test\test.txt file to c:\test\output.txt based on the following condition.
    Select data from text file that has a category of "Salads" and only return the name of the Salad to a text file.
    test.txt contains the following data
    1062,9971,Small Salad,,"40:""Salads"
    1063,9972,Large Pizza,,"60:""Pizzas"
    1065,9972,Large Salad,,"40:""Salads"
    Desired output
    Small Salad
    Large Salad

    Here's a couple options. Import the file as a CSV file, but only import the first three sections between commas. For instance, the first line of your test.txt file would import as 1062, 9971, and Small Salad. Then check for the word salad and write it out
    if it exists. Here's an example.
    $File = Import-Csv -Path C:\test\test.txt -Header One,Two,Three
    Foreach ($Entry in $File) {
    If ($Entry.Three -like '*salad') {
    Write-Output $Entry.Three
    As well, you could import all the contents of the file by changing the -Header parameter to One,Two,Three,Four,Five. Doing this, however, will mangle the data in Five because of the double quotes: "40:""Salads" would become 40:"Salads.
    Then you could do this the way to wanted to do this, by checking the category of salads. Here's an example of this, as well.
    $File = Import-Csv -Path C:\test\test.txt -Header One,Two,Three,Four,Five
    Foreach ($Entry in $File) {
    If ($Entry.Five -like '*salads') {
    Write-Output $Entry.Three
    Update: There are ways to read it in as a text file using Get-Content and then scanning each line, but because your source file has comma deliminators, it makes better sense to read it in as a CSV. To write this to a file, replace the Write-Output command with
    Add-Content -Value $Entry.Three -Path C:\test\output.txt

  • I backed up my bookmarks to an external drive, rebuilt my system, and now when I try to restore from that file, I get "unsupported file type" How can I restore from this file?

    I backed up my bookmarks to an external drive, rebuilt my system, and now when I try to restore from that file, I get "unsupported file type" How can I restore from this file?

    Make sure that the backup file with the bookmarks has the correct file extension: .html for a HTML backup and .json for a JSON backup.<br />
    You can check that via the right-click context menu of that file and open the Properties.<br />
    If you are not sure about the file type then you can open the file in Firefox via "File > Open File"<br />
    A JSON backup will show as one long text line without line breaks and a HTML backup as a web page with clickable links.<br />
    A JSON backup starts with: {"title":"","id":1,"dateAdded":<br />
    An HTML backup starts with: <nowiki><!DOCTYPE NETSCAPE-Bookmark-file-1></nowiki>
    You may need to add quotes ("") around the name to rename the file to the correct file extension.
    See also:
    * http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox

Maybe you are looking for

  • Can't upgrade from 10.1.3 to 10.4 (Tiger on DVD)

    I have an old iMac which I decided to upgrade to Tiger. I added RAM to get to 640 MB. Then I installed the 10.1.3 OS that came with the computer. Now I'm trying to upgrade it to Tiger (10.4) but the computer just spits out the disk whenever I insert

  • Service design for handling large datasets

    As an overnight process we need to invoke 2 services against every record in our database (over 1 million records). Specifically, the process flow should be as follows: - For each record in the database invoke service A. - For each record use the ret

  • ORA-12801: error signaled in parallel query server P007

    Hi friends, I am running a update on a big table with parallel clause. I got the below error.Can someone help what should i next? This query takes a long time to execute(nearly 1 hour). I searched on google and metalink but no success yet. ======= OR

  • Looking for a tutorial to make a paint splash

    I'm looking for a good tutorial to make a paint and water splash. It can be either for photoshop cs6 or illustrator cs6 or both. If anybody knows of one, I would appreciate it. p.s. I'm not looking to use a scatter effect. I'm looking for the glossy

  • Validate profit center in complete Project Structure

    Hi PS gurus, I want to validate profit center in (complete Project Structure) Project definition, WBS elements, N/W Header and N/W Activities. •     Presently in the WBS Element there is a possibility to check (Project definition and WBS elements) PR