Editing first few lines


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Editing first few lines
# 1  
Old 05-29-2008
Editing first few lines

Hello,

I've got a massive .txt file (over a gb in size) that I need to edit. I only need to edit the first 3 lines....

Is there a way for nano or vi to open just the first few lines for editing?


Thanks!
# 2  
Old 05-29-2008
I suggest: Run it through dd to split it into two chunks, edit the first bit, then rejoin them.
# 3  
Old 05-29-2008
hmm I didn't want to split up the file then merge ... is that my only option?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. UNIX for Dummies Questions & Answers

Editing strings within lines of file

Dear All, I have a file which contains a column with age, which is represented in two following patterns 1. "007/A" or ''007/a" or ''7 /a" ..... In this case A or a means year and I would like to extract only the numeric values eg 7 in the above case if this pattern exits in a line of file.... (5 Replies)
Discussion started by: pawannoel
5 Replies

3. Shell Programming and Scripting

editing headers

Hi, I have a folder that contains many (multiple) files 1.fasta 2.fasta 3.fasta 4.fasta 5.fasta . . 100's of files Each such file have data in the following format for example: vi 1.fasta 58 390 A GTATACATTATTGATGAAGTCCACATGCTTTCTATGGGTGCCTTCAATGCGCTTTTAAAA (7 Replies)
Discussion started by: Lucky Ali
7 Replies

4. Shell Programming and Scripting

substitution without editing

I have a script with 100's of lines in it. I want to edit the script with out manually openning it (with vi editor or some thing like that). Basically I want to do a substitution using regular expression (%s/G_/28_/i). Please let me know the best way to do this. (4 Replies)
Discussion started by: Lucky Ali
4 Replies

5. Shell Programming and Scripting

Read and editing

I got a text file with the following information: I need a script that (reads the file) asks the name and modifies his ip given by the user (new ip) and saves the edited information in the same file. I've been trying (I'm new to this) to use cut and grep but I've been unsuccessful. Thx (4 Replies)
Discussion started by: LoN
4 Replies

6. Shell Programming and Scripting

Editing columns

Hi, I have a file with a title for some rows but not all. I tried looking for examples of this but I am not sure what its called. The file looks something like this: name date 1 2 3 2 3 4 5 6 7 3 4 6 title author 1 3 5 2 3 5 2 3 2 Its hard to describe what I want to do with it but I... (4 Replies)
Discussion started by: kylle345
4 Replies

7. Shell Programming and Scripting

Editing a File

Hi all, I have a file with following contents # rad124 # radkus # raddebug # radtrace I could like to remove the # and space present before the key word "rad". Any ways to do this using "subsitution method(:%s/old/new/g)" will be hepful. (1 Reply)
Discussion started by: ramkriz
1 Replies

8. Linux

file editing

I have created a file with vi -x (file name) this is encrypted file when i again open this file it ask me to enter a password before editing it.Can i remove this password but i don't want to delete a file how to do this. Thanks (0 Replies)
Discussion started by: ambavaram
0 Replies

9. UNIX for Dummies Questions & Answers

How to count lines - ignoring blank lines and commented lines

What is the command to count lines in a files, but ignore blank lines and commented lines? I have a file with 4 sections in it, and I want each section to be counted, not including the blank lines and comments... and then totalled at the end. Here is an example of what I would like my... (6 Replies)
Discussion started by: kthatch
6 Replies

10. 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