text file editing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting text file editing
# 22  
Old 06-04-2008
you're welcome.
the number of lines should not matter - it should work on ANY number of lines.
# 23  
Old 06-04-2008
Hi, i have a file like this below, it worked on first 2 lines but not from the next, the error it was showing was "1086 "WPCW 19 - CW/A cannot be longer than 3000 bytes"

1081 "WPCW 19 - CW/AM1, WPCB 40 - FAMN/CORNER, WPCB-DT1 50 - FAMN/CORNER, "
W35AW - Various Shopping Pgms
W41CF - TBN
W47CV - TBN
WLLS-LP 49 - AM1
WATCH WPXI 11 N & WPIX 11 CW

1082 "WPCW 19 - CW/AM1, WTRF-DT2 32 - F/MY, WPCB 40 - FAMN/CORNER, "
"WKBS-DT1 46 - FAMN/CORNER, WKBS 47 - FAMN/CORNER, WPCB-DT1 50 - FAMN/CORNER"
W45BT - FAMN/CORNER
W47CV - TBN
WLLS-LP 49 - AM1
WATCH WPXI 11 N & WPIX 11 CW
WATCH WPGH 53 F & WWCP 08 F

1086 "WPCW 19 - CW/AM1, WFPT-DT3 28 - V-ME, WTRF-DT2 32 - F/MY, WPCB 40 - FAMN/CORNER,"
"WKBS-DT1 46 - FAMN/CORNER, WKBS 47 - FAMN/CORNER,"
"WPCB-DT1 50 - FAMN/CORNER, WGPT-DT3 54 - V-ME"
W35AW - Various Shopping Pgms
W47CV - TBN
WATCH WPXI 11 N & WPIX 11 CW
WATCH WPGH 53 F & WWCP 08 F

1087 "WPCW 19 - CW/AM1, WPCB 40 - FAMN/CORNER, WPCB-DT1 50 - FAMN/CORNER"
W29CO - FAMN
W47CV - TBN
WATCH WPXI 11 N & WPIX 11 CW
WATCH WPGH 53 F & WWCP 08 F

1088 "WPCW 19 - CW/AM1, WPCB 40 - FAMN/CORNER, WKBS-DT1 46 - FAMN/CORNER, "
"WKBS 47 - FAMN/CORNER, WPCB-DT1 50 - FAMN/CORNER"
W35AW - Various Shopping Pgms
W41CF - TBN
W45BT - FAMN/CORNER
W47CV - TBN
WLLS-LP 49 - AM1
WATCH WPXI 11 N & WPIX 11 CW
WATCH WPGH 53 F & WWCP 08 F




1121 "WNVT 30 - MHZ2, WPCB 40 - FAMN/CORNER, WMPT-DT3 42 V-ME"
WMJF-CA 16 - AM1
WDDN-LP 23 - DAYSTAR
WZDC-LP 25 - T
WNVT-DT1 30 - MHZ2
WMDO-CA 47 - L
"WUVP-DT2 66 - L, WQAW-LP 69 - Z"
WATCH WMPT 22 E & WPMT 43 F

1125 "WGTW-DT1 27 - TBN, WPCB 40 - FAMN/CORNER, WMPT-DT3 42 - V-ME, WGTW 48 - TBN"
W40AZ - TBN
"WUVP-DT2 66 - L, WQAW-LP 69 - Z"

1151 "WKOI-DT1 39 - TBN, WPCB 40 - FAMN/CORNER, WCLJ 42 - TBN, WKOI 43 - TBN,"
W36DG - TBN
WBQC-CA 38 - AM1
WRCX-LP 40 - AM1

1157 "WKOI-DT1 39 - TBN, WPCB 40 - FAMN/CORNER, WCLJ 42 - TBN, WKOI 43 - TBN, "
W07BY - AM1
W10BM - AM1
W17AY - TBN
WHAN-LP 17 - AM1
W24BW - AM1
W36DG - TBN
WBQC-CA 38 - AM1
WRCX-LP 40 - AM1
W50CI - HSN
WTHR 13 N - INDIANAPOLIS - BROADCASTS MOST OF THEIR PGMS
ON CENTRAL TIME INSTEAD OF EASTERN DURING THE SUMMER

1281 "WSBS-DT1 03 - MEGA TV, WPLG-DT2 09 - LATV, WPBT-DT2 18 - V-ME, WSBS 22 - MEGA TV,"
"WBFS-DT1 32 & WBFS 33 - MY/F, WPCB 40 - FAMN/CORNER, WHFT 45 - TBN, "
"WHFT-DT1 46 - TBN, WEDU-DT2 54 - V-ME, WHDT-DT1 59 - JWTV"
W16CC - HSN
WVFW-LP 34 - Almavison
WPMF-CA 38 - Z
WJAN-CA 41 - AMERICA TE VE (SPANISH)
WFUN-LP 48 - Caribevision
WSBS-CA 50 - MEGA TV - (OCL W21AX/GENTV)
WEYS-LP 56 - Almavision






1285 "WSBS-DT1 03 - MEGA TV, WPLG-DT2 09 LATV, WPBT-DT2 18 - V-ME, WSBS 22 - MEGA TV,"
"WBFS-DT1 32 & WBFS 33 - MY/F, WPCB 40 - FAMN/CORNER, WHFT 45 - TBN, "
"WHFT-DT1 46 - TBN, WHDT-DT1 59 - JWTV"
W16CC - HSN
WCAY-LP 34 - Almavision (Monroe County)
WVFW-LP 34 - Almavision
WJAN-CA 41 - AMERICA TE VE (SPANISH)
WFUN-LP 48 - Caribevision
WEYS-LP 56 - Almavision

2091 "WGEM 10 - N/F, KNLC-DT1 14 - FAMN, KNLC 24 - FAMN, WTCT 27 - TBN/TCT, "
"WPCB 40 - FAMN/CORNER, WGEM-DT1 54 - N/F "
KPTN-CA 7 - HSN
K22HG - TBN
KEFN-CA 28 - EWN
W29CI - 3ABN
K33GU - TBN
K49FC - 3ABN
W50CH - FAMN
KUMO-LP 51 - DAYSTAR
KTDL-LP 64 - DAYSTAR

2092 "KNLC-DT1 14 - FAMN, KNLC 24 - FAMN, WPCB 40 - FAMN/CORNER"
KPTN-CA 7 - HSN
K22HG - TBN
KEFN-CA 28 - EWN
K33GU - TBN
K49FC - 3ABN
W50CH - FAMN
KUMO-LP 51 - DAYSTAR
KDTL-LP 64 - DAYSTAR

2095 "WGEM 10 - N/F, KNLC-DT1 14 - FAMN, WTJR 16 - FAMN, KNLJ-DT1 20 - FAMN, "
"KNLC 24 - FAMN, KNLJ 25 - FAMN, WTCT 27 - TBN/TCT, WTJR-DT1 32 - FAMN,"
"WPCB 40 - FAMN/CORNER, WGEM-DT1 54 - N/F"
KPTN-CA 07 - HSN
K16FE - TBN
K22HG - TBN
WNOI-LP 24 - FAMN
KEFN-CA 28 - EWN
W29CI - 3ABN
K33GU - TBN
W50CH - FAMN
KUMO-LP 51 - DAYSTAR
KDTL-LP 64 - DAYSTAR


2131 WPCB 40 - FAMN/CORNER
K07UI - DAYSTAR
WCMN-LP 13 - AM1
WUMN-CA 13 - U
K14KH - 3ABN
K19BG - TBN
K19ER - EWN
K25IA - TBN
K53CH - EWN
WDMI-LP 62 - DAYSTAR

2136 WPCB 40 - FAMN/CORNER
K42FH - TBN
WDIO-DT2 43 - SPMC Pgms
K63CI - XWGN

2137 WPCB 40 - FAMN/CORNER
WCMN-LP 13 - AM1
WUMN-CA 13 - U
K14KE - FSNO
K14KH - 3ABN
K15DC - AEN
K16CG - DISC
K16CP - FSNO
K17CS - TBSC
K17FA - TVL
K18DI - TBSC
K19BG - TBN
K19CW - USA
K19ER - EWN
K21AK - NICK/NAN
K21DG - CNN
K21GN - CBC
K22DO - SPK
K23OF - DISC
K24CP - ESPN
K25EI - ESPN
K26CS - TBSC
K26DG - SHO1
K27EN - DISC
K28IF - TBN
K29CC - FXNC
K33CR - HIST
K34AF - RFD TV
K34DG - TWC
K35DC - TNT
K35DK - DISC
2137 K38CD - FSNO
CONT K39DZ - CNN
K40BU - FAMN
WDIO-DT2 43 - SPMC Pgms
K45DJ - ESPN
K46FY - DISC
K47EA - USA
K47KZ - DISC
K48AA - SHO1
K48GQ - TBSC
K49DB - TBSC
K49EO - DIY
K50DB - TWC
K51CY - USA
K51JY - HALL (OCL K65HD-Was CSPN)
K52DZ - HIST
K52GU - HIST
K53DI - SHO1
K54GH - FSNO
K55FJ - CNN
K55ID - GAC PGMS
K56HW - TBN
K58AS - FSNO
K58DS - MNBC
K58GC - 3ABN
K61EU - SPK
K62AU - CSPN (Was HALL)
K65BA - CNN
K67HI - TOC
K69DP - WX

2161 "KTAJ 16 -TBN, KTAJ-DT1 21 - TBN, KMCI-DT1 36 & KMCI 38 ""The Spot"" - I/F (PT), "
"WPCB 40 - FAMN/CORNER, KPXE 50 - ION/CHRISTIAN"
K45IO - HSN
KCDN-LP 35 - DAYSTAR
KUKC-LP 48 - U
K68DK - CNN/LOCAL PGMS









2165 "WGEM 10 - N/F, KXVO 15 - CW/F/ION, KNLJ-DT1 20-FAMN, KNLJ 25-FAMN, "
"KTAJ 16 - TBN, , KMCI-DT1 36 & KMCI 38 ""The Spot"" - I/F (PT),"
"KXVO-DT1 38 - CW/F/ION, WPCB 40 - FAMN/CORNER, KPTM 42 & KPTM-DT1 43 - F/ION,"
"KPXE 50 - ION/CHRISTIAN, WGEM-DT1 54 - N/F"
K45IO - HSN
K35CT - DAYSTAR
KUKC-LP 48 - U
K56AU - TBN

2171 "WMVS-DT2 08 - V-ME, WCGV 24 & WCGV-DT1 25 - MY/F, WPCB 40 - FAMN/CORNER, "
"WWRS-DT1 43 - TBN, WWAZ-DT1 44 - FAMN, WPWR 50 & WPWR-DT1 51 - MY/F, "
"WWRS 52 - TBN, WXFT-DT1 59-L, WXFT 60 - L, WWAZ 68 - FAMN"
WMKE-CA 07 - America One (AM1)
WBWT-LP 38 - Z
WMLW-LP 41- I/F (PT)
WTTW-DT4 47 - V-ME
WYTU-LP 63 - T

2175 "WMVS-DT2 08 - V-ME, WCGV 24 & WCGV-DT1 25 - MY/F, WQRF 39 - F/HSN, "
"WPCB 40 - FAMN/CORNER, WWRS-DT1 43 - TBN, WWAZ-DT1 44 - FAMN, ,"
"WPWR 50 & WPWR-DT1 51 - MY/F, WWRS 52 - TBN, WXFT-DT1 59 - L, WXFT 60 - L, "
WWAZ 68 - FAMN
WMKE-CA 07 - America One (AM1)
W38CT-TBN
WBWT-LP 38 - Z
W40BY - TBN
WMLW-LP 41- I/F (PT)
WTTW-DT4 47 - V-ME
WCFC-CA 51 - FAMN/TLN
WYTU-LP 63 - T
W65EE - TBN
# 24  
Old 06-04-2008
this is the limitation of awk.
If you have gawk, try it.
If you're under Solaris, try /usr/xpg4/bin/awk.
# 25  
Old 06-04-2008
oh is it, i have only awk, gawk is not working, and am on HP, please help
# 26  
Old 06-04-2008
sorry, if this the only awk you have and it has the limitation, someone else will have to help you with other tools.
# 27  
Old 06-04-2008
what version of HP-UX do you have?
Dpending on the version, you might have multiple awk available to you:
Code:
HP-UX 09.05 (HP-UX 09.05 A 9000/735)
  	/app/itools/bin/gawk 	/app/itools/bin/igawk 	/usr/bin/awk 	/usr/intel/bin/gawk /usr/intel/bin/igawk 	/usr/local/bin/gawk

HP-UX 10.20 (HP-UX 10.20 A 9000/839)
	/usr/bin/awk 	/usr/local/bin/mawk

HP-UX 11.0 (HP-UX 9000/800)
  	/usr/bin/awk

HP-UX 11.11 (HP-UX 11.11 9000/800)
  	/sbin/awk 	/usr/bin/awk

Consult the AWK Compatibility List
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Editing long text file

Good morning all, I have a machine running IRIX and I need to edit a text file on the terminal that is literally thousands of lines. Does anyone know the most efficient way to edit portions of files like these? Obviously simply using the vi command isn't going to work since I get a too many lines... (1 Reply)
Discussion started by: James C
1 Replies

2. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies

3. Shell Programming and Scripting

Help needed editing text file using the terminal

Hi, I have text file with the header like this tracking_id condition replicate FPKM XLOC_000001 alpha 1 10.3199 XLOC_000001 alpha 0 10.3686 XLOC_000001 alpha 2 15.5619 ... With the first column being genes, the second being the condition, the third... (5 Replies)
Discussion started by: 4galaxy7
5 Replies

4. Shell Programming and Scripting

editing line in text file adding number to value in file

I have a text file that has data like: Data "12345#22" Fred ID 12345 Age 45 Wilma Dino Data "123#22" Tarzan ID 123 Age 33 Jane I need to figure out a way of adding 1,000,000 to the specific lines (always same format) in the file, so it becomes: Data "1012345#22" Fred ID... (16 Replies)
Discussion started by: say170
16 Replies

5. Programming

Editing a specific liine of text file - C++

Is there any way to erase all the contents of a specific line of a text file and then write something on it? e.g. test.txt.old: qwert asdfg zxcbv=0 test.txt.new qwerty asdfg hello=0 is this possible with C++ ?:confused: (1 Reply)
Discussion started by: hakermania
1 Replies

6. Shell Programming and Scripting

Editing text using AWK

France : 40 : John Persia : 50 : John -----Database What i am trying to achieve is to search for a book, and replave the title with the new title echo -n "Title:" read Title echo -n "Author:" read Author echo "new Title" read NewTitle awk 'BEGIN {... (11 Replies)
Discussion started by: gregarion
11 Replies

7. Shell Programming and Scripting

Text editing script does everything but edit text.

I wrote this script to create and edit a large number of websites based on a template site and a collection of text files which have the relevant strings in them delimited by colons. I run it and the shell doesn't produce any errors, but when it gets to the for loop where it actually has to edit... (2 Replies)
Discussion started by: afroCluster
2 Replies

8. UNIX for Dummies Questions & Answers

Text editing on iPhone using ed

Hi all, I'm trying to edit a file using ed on an iphone. I am trying to edit a conf file and have managed to get to the directory where the default.conf file is located, however, when I type ed default.conf all i get is a number and then a blank line and a question mark which is why I am... (1 Reply)
Discussion started by: drewcifer
1 Replies

9. UNIX for Dummies Questions & Answers

Text Editing

Hello everybody, I have a sorted text file. some of the lines appear twice or even more. is there an unix utility that removes the extra appearences? Thanks, Ido. (7 Replies)
Discussion started by: ginodii
7 Replies
Login or Register to Ask a Question