![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Truncate multiple file extensions | prvnrk | Shell Programming and Scripting | 12 | 04-04-2008 10:20 AM |
| truncate file script is not working | mvenkat_in | Shell Programming and Scripting | 3 | 10-24-2007 01:01 AM |
| Truncate File contain | rinku | Shell Programming and Scripting | 2 | 05-30-2007 06:43 AM |
| how to truncate a large (8 GB) file | kotasateesh | Shell Programming and Scripting | 1 | 07-05-2006 01:57 AM |
| Truncate what is It? | rocker40 | UNIX for Dummies Questions & Answers | 2 | 10-11-2003 07:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 to remove. |
|
||||
|
Think I've found my fix unless someone has a more elegant solution...
# Set Split Size 1 Byte Less than Total ((SPLITSIZE=`wc -m $SRCFILE | awk '{print $1}'` - 1)) # Split File split -b $SPLITSIZE $SRCFILE $SRCFILE. # Concatenate Header with Second File cat $SRCFILE.aa $SCNDFILE > mergefile.pcl # Clean up detritus rm $SRCFILE*.* |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|