Find the answer to your Linux question:
Results 1 to 3 of 3
I have a file containing n table names and corresponding column name separated by white space(tablename fieldname).I want to traverse line by line taking each table name and corresponding field ...
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Posts
    4

    Question Shell Script for file manipulation

    I have a file containing n table names and corresponding column name separated by white space(tablename fieldname).I want to traverse line by line taking each table name and corresponding field name and then execute an update query in the database.All I need is how do I read the file line by line.When I echo'ed the file in a for loop it seems it displays all the tables in one iteration.Can anybody help on this.

  2. #2
    Linux Engineer aliov's Avatar
    Join Date
    Dec 2006
    Location
    Geneva,Beirut
    Posts
    1,078
    sed '52q;d' replace 52 with the line number you want. other combination is possible to loop other the file.

    let me now if you need more information.
    Linux is not only an operating system, it's a philosophy.
    Archost.

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Posts
    4

    Smile thx

    Thanks I used "awk" to accomplish the task.thx for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...