Sponsored Content
Full Discussion: trimming a file...
Top Forums UNIX for Dummies Questions & Answers trimming a file... Post 2137 by 98_1LE on Monday 23rd of April 2001 02:33:41 PM
Old 04-23-2001
Code:
head -x file > /tmp/file
mv /tmp/file file

Replace x with the number of lines you wish to keep. This will keep lines from the top. If you wish to keep lines counting from the bottom, replace head with tail.
-Chuck
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trimming a string

Hi, I am trying to find a script command that will let me trim leading and trailing space from a string. I have coded a SQL Select and sending the output to a file. Later I am parsing the file and reading each field. The problem is that each field uses the same size as the DB2 type it was defined... (2 Replies)
Discussion started by: fastgoon
2 Replies

2. UNIX for Advanced & Expert Users

trimming zeros

Hi, I want to trim +with leading zero's with amount fields.I know using awk for trimming leading zeros with +,but I want get the entire row itself. cat file_name |awk -F " " '{printf "%14.4f%f\n",$4}' ex: 10 xyz bc +00000234.4500 20 yzx foxic +002456.000 Expexted 10 xyz bc... (3 Replies)
Discussion started by: mohan705
3 Replies

3. UNIX for Advanced & Expert Users

Trimming the spaces

Hi, How can I remove the unwanted spaces in the line. 123456 789 ABC DEF. - I wanna remove the sapces in this line, I need the output 123456789ABCDEF. Pls help me...... (3 Replies)
Discussion started by: sharif
3 Replies

4. UNIX for Dummies Questions & Answers

trimming whitespaces in a file

Hello, Im trying write a bash sript to search a file and identify any file names that contain a space at the end of them. I was trying to use the grep command but I can find how I would identify the character I'm looking for. Any help would be grately appreciated. (2 Replies)
Discussion started by: gintreach
2 Replies

5. Shell Programming and Scripting

Trimming fields for comma or pipe seperated file

I have file like this FileA: abc , "helloworld" , america def,asia, japan ghi, africa, ipl Output Needed: abc,"helloworld",america def,asia,japan ghi,africa,ipl I would like to implement using awk. I want to trim each field for its leading and trailing spaces. (7 Replies)
Discussion started by: pinnacle
7 Replies

6. Shell Programming and Scripting

Trimming output

I'm trying to parse an output log and I've managed to reduce the output to the lines I need. But I'm having trouble pulling out only the info I'm interested in. The output is 40+ lines and here is a sample Installing AppFresh 0.8.5.pkg from ./InstallerFiles/CustomPKG/26 (26) Installing... (2 Replies)
Discussion started by: kaltekar
2 Replies

7. UNIX for Dummies Questions & Answers

Trimming a file from command prompt!

I have a text file. I want the top 100 lines of this file to be deleted that too from command line using minimum command input. Please tell! (1 Reply)
Discussion started by: nixhead
1 Replies

8. Shell Programming and Scripting

Trimming a string

Hi I need to trim white spaces from strings in a file. Input file is like this: 1_rrc_CatalogGroups.csv = 607 1_rrc_Sales_TopCatalogGroups.csv = 4 1_rrc_Sales_CatalogEntries_CatalogGroup_Rel.csv = 7 Need to trim space before and after = symbol. This is my script: #!/usr/bin/ksh ... (2 Replies)
Discussion started by: sukhdip
2 Replies

9. Shell Programming and Scripting

Trimming in between the words

Hi i have a log file P12345_15728710:DEBUG:Begin P12345_15728710:DEBUG:Being P12345_15729310:DEBUG:GetAgen P12345_15726510:DEBUG:end i want to trim this file and i want like this 15728710 15728710 15729310 15726510 i tried sed ..but not working.. sed "s/.*P12345__ \(.*\)... (4 Replies)
Discussion started by: navsan420
4 Replies

10. UNIX for Dummies Questions & Answers

Trimming ends

My files look like this I need to remove the sequence GGGAAA and anything before that I also need to remove the sequence AGCCCTA and anything after that So I will end up with something like this The left side is done but I cannot get the right side correctly. I would like to use... (3 Replies)
Discussion started by: Xterra
3 Replies
GIT-MERGE-FILE(1)						    Git Manual							 GIT-MERGE-FILE(1)

NAME
git-merge-file - Run a three-way file merge SYNOPSIS
git merge-file [-L <current-name> [-L <base-name> [-L <other-name>]]] [--ours|--theirs|--union] [-p|--stdout] [-q|--quiet] [--marker-size=<n>] [--[no-]diff3] <current-file> <base-file> <other-file> DESCRIPTION
git merge-file incorporates all changes that lead from the <base-file> to <other-file> into <current-file>. The result ordinarily goes into <current-file>. git merge-file is useful for combining separate changes to an original. Suppose <base-file> is the original, and both <current-file> and <other-file> are modifications of <base-file>, then git merge-file combines both changes. A conflict occurs if both <current-file> and <other-file> have changes in a common segment of lines. If a conflict is found, git merge-file normally outputs a warning and brackets the conflict with lines containing <<<<<<< and >>>>>>> markers. A typical conflict will look like this: <<<<<<< A lines in file A ======= lines in file B >>>>>>> B If there are conflicts, the user should edit the result and delete one of the alternatives. When --ours, --theirs, or --union option is in effect, however, these conflicts are resolved favouring lines from <current-file>, lines from <other-file>, or lines from both respectively. The length of the conflict markers can be given with the --marker-size option. The exit value of this program is negative on error, and the number of conflicts otherwise. If the merge was clean, the exit value is 0. git merge-file is designed to be a minimal clone of RCS merge; that is, it implements all of RCS merge's functionality which is needed by git(1). OPTIONS
-L <label> This option may be given up to three times, and specifies labels to be used in place of the corresponding file names in conflict reports. That is, git merge-file -L x -L y -L z a b c generates output that looks like it came from files x, y and z instead of from files a, b and c. -p Send results to standard output instead of overwriting <current-file>. -q Quiet; do not warn about conflicts. --diff3 Show conflicts in "diff3" style. --ours, --theirs, --union Instead of leaving conflicts in the file, resolve conflicts favouring our (or their or both) side of the lines. EXAMPLES
git merge-file README.my README README.upstream combines the changes of README.my and README.upstream since README, tries to merge them and writes the result into README.my. git merge-file -L a -L b -L c tmp/a123 tmp/b234 tmp/c345 merges tmp/a123 and tmp/c345 with the base tmp/b234, but uses labels a and c instead of tmp/a123 and tmp/c345. GIT
Part of the git(1) suite Git 1.8.5.3 01/14/2014 GIT-MERGE-FILE(1)
All times are GMT -4. The time now is 01:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy