Sponsored Content
Top Forums Shell Programming and Scripting Truncate extra contents from file Post 302320800 by BubbaJoe on Friday 29th of May 2009 02:34:20 AM
Old 05-29-2009
cat inputfile | cut -d"/" -f1-6 > newfile
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to truncate a large (8 GB) file

Hello, I need to truncate a large file without deleting and touching it again. i tried the below commands but no use because of the huge file size cat <<! > errors and echo > errors Could someone please help. Thanks, Sateesh (1 Reply)
Discussion started by: kotasateesh
1 Replies

2. Shell Programming and Scripting

Truncate File contain

I have one file which first line is blank and second line has some data. $cat filename output: 30-MAY-07 I want to store 30-MAY-07 value in one variable. for that I wrote var="`head -2 filename`" It will give that result but I want to truncate the first line which is blank. plz help. (2 Replies)
Discussion started by: rinku
2 Replies

3. Shell Programming and Scripting

truncate file script is not working

Hi All, I have an application which writes log in to a file. The file size becomes around min of 800 MB a day. So I have written a script which backup the file and truncate the original file. My script is like this cp X.log /backup/X.log1 > X.log But the second truncate command... (3 Replies)
Discussion started by: mvenkat_in
3 Replies

4. UNIX for Dummies Questions & Answers

Truncate last <n> characters from a file

I am trying to concatenate 2 files, but before concatenation, I would like to strip off the final character from the first file. The final character is a form feed (ascii 012 / hex 0C) and there will be an unknown number of these characters in the file. It is only the very last one which I want... (1 Reply)
Discussion started by: Gwailo88
1 Replies

5. UNIX for Dummies Questions & Answers

How to truncate thousands of file names

Folder of e-mails in maildir format had been corrupted. Typical file name is 1246281161.6777.m21JH:2,S . The " :2,S prevents " copying to another device. How can I simply remove the last four characters? (2 Replies)
Discussion started by: steve900
2 Replies

6. Shell Programming and Scripting

Truncate file name to 40 characters

Hello all. I would like to make a script (or two shell scripts) that will do the following. I need the maximum file name and directory name to be 38 characters long. As well, if shortening the file name ends up making all of the files in that directory have the same name, then I would like... (9 Replies)
Discussion started by: marcozd
9 Replies

7. UNIX for Dummies Questions & Answers

compare 2 file contents , if same delete 2nd file contents

Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents..... I try with "diff"...... but confusion how to use "diff" with if ---else Thanking you (5 Replies)
Discussion started by: krishnampkkm
5 Replies

8. UNIX for Dummies Questions & Answers

recover the truncate file

hi All, how to recover the truncate file in unix. Thanks!:wall: (2 Replies)
Discussion started by: krbala1985
2 Replies

9. Shell Programming and Scripting

Replace partial contents of file with contents read from other file

Hi, I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file. i am able to... (2 Replies)
Discussion started by: seeki
2 Replies

10. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

Hi one of the output of the command is as below # sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/' Resource List : <br> *************************** 1. row ***************************<br> ... (2 Replies)
Discussion started by: vivek d r
2 Replies
MKERRLST(1)						      General Commands Manual						       MKERRLST(1)

NAME
mkerrlst - create system error file SYNOPSIS
mkerrlst [ -i inputfile ] [ -o outputfile ] DESCRIPTION
Mkerrlst(1) creates error message files in the format described by syserrlst(5). With no arguments mkerrlst creates the file /etc/syserrlst from the internal array sys_errlist. Give just the -o option mkerrlst will create the file outputfile from the internal array sys_errlist. Given just the -i option mkerrlst will create the file /etc/syserrlst from the input file inputfile. Given both -i and -o options mkerrlst will create the error message file outputfile from the strings contained in inputfile. NOTE: error messages are numbered from 0. If the error 0 does not have a message associated with it the first string in inputfile must still be present. RETURN VALUE
mkerrlst exits with status of 0 if no errors are encountered. If errors do occur an error message is printed on stderr and the exit status is 1. ERRORS
mkerrlst(1) can encounter any of the errors for the open(2), lseek(2), read(2), or write(2) system calls. SEE ALSO
syserrlst(3) syserrlst(5) HISTORY
mkerrlst(1), first appeared in 2.11BSD. BUGS
Error messages can be a maximum of 80 characters. 3rd Berkeley Distribution March 14, 1996 MKERRLST(1)
All times are GMT -4. The time now is 10:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy