Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: zanzemaj
  • Order by date
  1. zanzemaj

    Transform contents of text file

    Thank you vgersh99, it works as expected. Great help!
  2. zanzemaj

    Transform contents of text file

    Thank you Columb, I really appreciate your help. However, can anyone suggest something I could use in ksh? Thank you in advance for your replies.
  3. zanzemaj

    Transform contents of text file

    Hi, I need help in transforming a text file. Here is an example of file1.txt: pos1 TABLE ah_feed 3828 48 pos1 TABLE ah_feed 7402 103 po1 VWW ah_feed 1234 123 po1 VWW ah_feed 1234 123 pos2 TABLE DEPT_XREF 6365942 181866 pos2 TABLE DEPT_XREF 12758867 364521 pos2 VWW dep_f 122 2 pos2 TABLE...
  4. zanzemaj

    Hoe to check values in a file

    This is my starting point: awk '{print $5}' stat.txt This produces: ID 20:32:18 Statcode -------- 4 4 12 How do I get the values of Statcode (which for this file is 4,4,12 and check them, if I get a 12 or 8, message an error)
  5. zanzemaj

    Hoe to check values in a file

    I am using a ksh script. Please help me read and get values from this file called stat.txt: Job information for Job ID '465' using a Traditional view Job "PD1002_predefined" - 2007-06-21 20:32:18 (ID 465) Operation: ARCHIVE TDPID: 1 Streams: 3 Stream Client...
  6. zanzemaj

    Delete data or lines in a file

    Yes and your solution does that. I was thinking that I can issue another command to take that line away for sed. Thank you for your solution since it does the requirement in one step.
  7. zanzemaj

    Delete data or lines in a file

    Thank you PHV for your response. I was tweaking a while ago and this also works: sed -n "/ARCHIVING DATABASE/,/STREAM TOTALS/p" stream.txt
  8. zanzemaj

    Join 2 lines

    Thank you aigles for your response. I really appreciate all your help. Your solution works! [thumbsup2]
  9. zanzemaj

    Delete data or lines in a file

    I have a file stream.txt and I need to disregard the lines STREAM TOTALS and lines after that. But I want to include all lines with ARCHIVING DATABASE and lines after that. 06/15/2007 22:18:51 ARCHIVING DATABASE "BACKUP_CONTROL_DEV" 06/15/2007 22:18:53 TABLE "ARCHIVE_DB" - 438 BYTES, 0 ROWS...
  10. zanzemaj

    Join 2 lines

    I have a textfile named table1.txt and I want to write the records in one line. If the next line do not have any date before the line or there is a blank, this line should be paste on the first line. I would appreciate any help in solving this problem. I tried to do this, but not working tr -s...
  11. zanzemaj

    How to read and manipulate file?

    Thank you for your response. I modified it a little to output to a new file, I used the code inside the KSH script. It works as expected. awk ' /ARCHIVING DATABASE/ { db_prefix = "ARCHIVING DATABASE " $5; print db_prefix; next; } $3 ~ /TABLE/ { out = db_prefix...
  12. zanzemaj

    How to read and manipulate file?

    Thank you Jean-Pierre for the quick reply. However, I need to put the code inside a KSH script, this below do not work. I am really new with awk and would like to ask your assistance how to read this tmp.txt file. #!/usr/bin/ksh awk '/ARCHIVING DATABASE/ { db_prefix = "ARCHIVING DATABASE "...
  13. zanzemaj

    How to read and manipulate file?

    I have a textfile named tmp.txt which contains the following record: 06/13/2007 23:05:23 ARCHIVING DATABASE "table1" 06/13/2007 23:05:28 "table1" - LOCK RELEASED 06/13/2007 23:05:28 06/13/2007 23:05:28 ARCHIVING DATABASE "arctab3" 06/13/2007 23:05:30 TABLE "ARCHIVE_DB" - 438 BYTES, 0 ROWS...
  14. zanzemaj

    How to remove words in a textfile

    Thank you p5wizard and PHV for your replies. Everything works! [2thumbsup]
  15. zanzemaj

    How to remove words in a textfile

    Thank you p5wizard, this works as expected. One more question, how do I remove multiple spaces? I need only one space between the fields. Thanks.
  16. zanzemaj

    How to remove words in a textfile

    I have a text file named tmp4.txt with sample records: MISC_INT 05/30/2007 12:14:20 TABLE xx_httj 4,150 BYTES, 63 ROWS ARCHIVED FOR THIS STORE_INT 05/30/2007 12:14:22 VIEW fret_xxfe 6,392,925 BYTES, 182,655 ROWS STORE_INT 05/30/2007 12:14:25 TABLE bkup_x 4,756,990 BYTES, 135,914 ROWS...
  17. zanzemaj

    Join two lines

    Hi, just a variation on the solved question... I modified the sample data. What if I need to get the words/data after ARC0: Completed archiving? And then save this in variables like mylog=log 2 mythread=thread 1 . . . . . . . . . . Creating archive destination LOG_ARCHIVE_DEST_1: ARC0...
  18. zanzemaj

    How to read records and values in a file?

    That was fast, and it works. I also changed the code so that there will be sleep once only. typeset -i i=2 while ((i-=1)); do awk ' $5=="Excode"{r=NR+1} r && NR>r && NF==5 && $5{exit 1} ' fexit.txt && break sleep 60 done ((i)) || echo "ERROR" Thank you so much, and I am learning a lot...
  19. zanzemaj

    How to read records and values in a file?

    Thank you PHV, your code works as expected. I have one more question, what if I want to check only twice? When I find a non-zero Excode, go to sleep 60 and then check again. After the second try, if I find a non-zero Excode again, then Error.
  20. zanzemaj

    How to replace a comma to a semicolon in a textfile?

    Thank you for all the replies. I tried it and everything works as expected. [2thumbsup]

Part and Inventory Search

Back
Top