Sponsored Content
Full Discussion: del 1st 2 lines
Top Forums UNIX for Dummies Questions & Answers del 1st 2 lines Post 302367774 by tjmannonline on Tuesday 3rd of November 2009 12:00:38 PM
Old 11-03-2009
del 1st 2 lines

filename.txt

Code:
VOL1000499
HDR1ACHTAP           
101 031100225 0311002250911030803A094101WACHOVIA BANK OF 
5200MASTER PAY GROUP                    4231352166PPDAP PAYMENT      091026   1031100220000001
6221110000123756570069       00071351691000-     4022 FISHER HEALTHCARE       0031100220000001
6221110000123756570069       00030000001000-     4022 FISHER HEALTHCARE       0031100220000002


currently, i head -2 filename.txt, and using grep -v line1 and line2

is it a better way to del the 1st 2 lines ?

Last edited by vgersh99; 11-03-2009 at 01:11 PM.. Reason: code tags, please!
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how tp del progs

ermm... wats the general commands to uninstall programs.....izzit rpm -e cos it keep telling me package not installed..... anyway anyone know any good links for licq for redhat 9.0 shrike ... cos downloaded one ... dun seems to be working ... trying to get rid of it appreciate if anyone can... (3 Replies)
Discussion started by: kaya
3 Replies

2. UNIX for Dummies Questions & Answers

route del trouble

Hi, I'm having trouble deleting a route: # route del 192.168.0.0 SIOCDELRT: Invalid process # route del -net 192.168.0.0 SIOCDELRT: Invalid argument The route is in the table: # route Destination Gateway Genmask Flags Metric Ref Use Iface 192.168.0.0 ... (1 Reply)
Discussion started by: spaesani
1 Replies

3. UNIX for Dummies Questions & Answers

How to del word by random input?

Hi, I got big problem. a line contains like this: Hell "A,B,C", how to delete A or B or C by using sed or other tools? I do not have any idea. Many thanks. (2 Replies)
Discussion started by: lemon_06
2 Replies

4. Shell Programming and Scripting

need to delete all lines from a group of files except the 1st 2 lines

Hello, I have a group of text files with many lines in each file. I need to delete all the lines in each and only leave 2 lines in each file. (3 Replies)
Discussion started by: script_op2a
3 Replies

5. Shell Programming and Scripting

awk to del files

Hi, I want to delete files but it has space beween name & .log For ex -rw-r--r-- 1 root other 5429 Mar 19 2008 \AnjuP .log -rw-r--r-- 1 root other 1352 Mar 21 2008 \ranjap .log -rw-r--r-- 1 root other 1355 Mar 29 2008 \varghp .log so if I run ls -ltr | head -3 | awk '{print $9 $10}... (8 Replies)
Discussion started by: tuxian
8 Replies

6. UNIX for Dummies Questions & Answers

del lines

i have file that looks like this: 031000503 2000049262784 LCK00000050 i want to look like this: 031000503 2000049262784 LCK00000050 i'd like to del 10-15 Please use code tags! (6 Replies)
Discussion started by: lawsongeek
6 Replies

7. Shell Programming and Scripting

not del a file not affecting other permissions

i was faced by a question from a friend. i found it very tricky. all my months of learning unix i never can figure it out still. heres the question he faced me with. wondering if you all can help me figure a solution. ill let him know the forums helped me out :D What command would you use... (10 Replies)
Discussion started by: sunny231
10 Replies

8. UNIX for Dummies Questions & Answers

append following lines to 1st line, every 3 lines

I have output like this: USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 ... where USER_ID is a unique user login followed by their login timestamp and... (6 Replies)
Discussion started by: MaindotC
6 Replies

9. Shell Programming and Scripting

Del Line if specific issue

HI Guys I have below input : PO 121255 SorkO_RM_,rlsmel=310_410_3_11104_43831 PO 125564 SorkO_RM_,rlsmel=007G43823 I want delete line which have "_" after = Sign Output : PO 125564 SorkO_RM_,rlsmel=007G43823 (2 Replies)
Discussion started by: pareshkp
2 Replies
dos2unix(1)						      General Commands Manual						       dos2unix(1)

NAME
dos2unix - DOS/MAC to UNIX text file format converter SYNOPSYS
dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...] Options: [-hkqV] [--help] [--keepdate] [--quiet] [--version] DESCRIPTION
This manual page documents dos2unix, the program that converts plain text files in DOS/MAC format to UNIX format. OPTIONS
The following options are available: -h --help Print online help. -k --keepdate Keep the date stamp of output file same as input file. -q --quiet Quiet mode. Suppress all warning and messages. -V --version Prints version information. -c --convmode convmode Sets conversion mode. Simulates dos2unix under SunOS. -o --oldfile file ... Old file mode. Convert the file and write output to it. The program default to run in this mode. Wildcard names may be used. -n --newfile infile outfile ... New file mode. Convert the infile and write output to outfile. File names must be given in pairs and wildcard names should NOT be used or you WILL lost your files. EXAMPLES
Get input from stdin and write output to stdout. dos2unix Convert and replace a.txt. Convert and replace b.txt. dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convert and replace a.txt in ASCII conversion mode. Convert and replace b.txt in ISO conversion mode. Convert c.txt from Mac to Unix ascii format. dos2unix a.txt -c iso b.txt dos2unix -c ascii a.txt -c iso b.txt dos2unix -c mac a.txt b.txt Convert and replace a.txt while keeping original date stamp. dos2unix -k a.txt dos2unix -k -o a.txt Convert a.txt and write to e.txt. dos2unix -n a.txt e.txt Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt. dos2unix -k -n a.txt e.txt Convert and replace a.txt. Convert b.txt and write to e.txt. dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convert c.txt and write to e.txt. Convert and replace a.txt. Convert and replace b.txt. Convert d.txt and write to f.txt. dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt DIAGNOSTICS
BUGS
The program does not work properly under MSDOS in stdio processing mode. If you know why is that so, please tell me. AUTHORS
Benjamin Lin - <blin@socs.uts.edu.au> Bernd Johannes Wuebben (mac2unix mode) <wuebben@kde.org> MISCELLANY
Tested environment: Linux 1.2.0 with GNU C 2.5.8 SunOS 4.1.3 with GNU C 2.6.3 MS-DOS 6.20 with Borland C++ 4.02 Suggestions and bug reports are welcome. SEE ALSO
unix2dos(1) mac2unix(1) 1995.03.31 dos2unix v3.0 dos2unix(1)
All times are GMT -4. The time now is 08:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy