Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Super Simple Script to remove first characters of any png file Post 302776481 by alister on Wednesday 6th of March 2013 11:50:17 AM
Old 03-06-2013
Quote:
Originally Posted by Corona688
I'd try this in a busybox shell:

Code:
( dd bs=2 count=1 > JUNK ; cat ) < $FILE > new-$FILE

dd's skip obviates both cat and the subshell. Therefore, it is with a heavy heart that I must award you this useless use of cat award Smilie

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find and remove characters

Hi. I have many files in a folder, and even more in the subfolders. I need a script that finds and removes certain characters (them being /n in this one) in the files in the folder and it's subfolders. So, could someone write me a script that works in Linux, does this: Searchs for "/n" in... (5 Replies)
Discussion started by: Zerby
5 Replies

2. Shell Programming and Scripting

SUPER simple bash script to repeat a command...

I need to repeat this command on a configurable interval: igal -a -r -U -w 6 I tried this: #!/bin/bash igal -a -r -U -w 6 sleep 30 Just a guess that it MIGHT work. Can anyone point me in the right direction? -R (6 Replies)
Discussion started by: robfindlay
6 Replies

3. Shell Programming and Scripting

Remove characters from file name

Here is my code. for file in *1.3.html ; do mv "$file" `echo $file | tr '.1.3' ''` ; done For some reason I am getting an error. mv: file.idlesince.1.3.html and file.idlesince.1.3.html are identical Could this be done a different way? (5 Replies)
Discussion started by: mrlayance
5 Replies

4. Shell Programming and Scripting

Trying to remove '^M' characters from a file.

Hi guys, Hope you are all well. This is a line of data from a csv file. I have used vi and set the 'set list' option to display the trailing $ character. "01","Grocery","01006","eat Fish & Spreads"$ I have tried the following commands, but neither of them appear to be working? 1) tr... (13 Replies)
Discussion started by: Krispy
13 Replies

5. Shell Programming and Scripting

How to remove Ctlr-M characters from file from a unix script

There are 10 files present which have Ctlr-M characters appended to each line of all files. I have a unix script which processes the files in a loop. And there is an inner loop which processes each line in the file concerned. #inputFile is a variable which has the file name of the input... (2 Replies)
Discussion started by: akashtcs
2 Replies

6. Shell Programming and Scripting

Remove the characters from the file

Hi, I have one file in the following format. exa_resu_adj.4ge v.47645 PERSONAL INFORMAIONS PVT LTD 31 Dec 2009 04:36 Page 1 SALARY REPORT Account Account Name CCode Bill No Balance T Amt ----------- ------------ ------- ---------- ------------- ------------- 17490001 Mr Ram PM 10... (6 Replies)
Discussion started by: Kattoor
6 Replies

7. Shell Programming and Scripting

cgi script to print all .png files on a single page

Hi guys I'm relativley new to Perl, and have not touched html before, im trying to write a cgi script that prints all images on a single html page from a given directory. Im using perl to gather stats, rrdtool to update and create graphs now i just need to print these graphs all onto 1 index.cgi... (3 Replies)
Discussion started by: jeffersno1
3 Replies

8. Shell Programming and Scripting

Want to remove the last characters from each row of csv using shell script

Hi, I've a csv file seperated by '|' from which I'm trying to remove the excess '|' characters more than the existing fields. My CSV looks like as below. HRLOAD|Service|AddChange|EN PERSONID|STATUS|LASTNAME|FIRSTNAME|ITDCLIENTUSERID|ADDRESSLINE1 10000001|ACTIVE|Testazar1|Testore1|20041|||... (24 Replies)
Discussion started by: rajak.net
24 Replies

9. UNIX Desktop Questions & Answers

Remove new line characters from a file

I tried using below command tr -cd "" < InputFile.xml > output.txt ============= This removes all the tabs/newline/extra spaces from a file it successfully removed all the extra spaces,tabs and new line characters but then the complete file become one record. I want to retain one new line... (1 Reply)
Discussion started by: saini
1 Replies

10. Shell Programming and Scripting

Remove characters from the file

i know , the below question has been repeated. can you guys guide me . I have the below input 999999 xxxxxxxxxxxxxx 123.45 2013-05-02 08:14 1 1 1 xxxx 999999 xxxxxxxxxxxxxx 123.45 2013-06-02 02:14 1 4 1 dddd i need to remove from the column 54 to 70 , as like the below output.... (9 Replies)
Discussion started by: expert
9 Replies
png(n)								Image manipulation							    png(n)

__________________________________________________________________________________________________________________________________________________

NAME
png - PNG querying and manipulation of meta data SYNOPSIS
package require Tcl 8.2 package require crc32 package require png ?0.1.2? ::png::validate file ::png::isPNG file ::png::imageInfo file ::png::getTimestamp file ::png::setTimestamp file time ::png::getComments file ::png::removeComments file ::png::addComment file keyword text ::png::addComment file keyword lang keyword2 text _________________________________________________________________ DESCRIPTION
This package provides commands to query and modify PNG images. PNG stands for Portable Network Graphics and is specified at http://www.libpng.org/pub/png/spec/1.2. COMMANDS
::png::validate file Returns a value indicating if file is a valid PNG file. The file is checked for PNG signature, each chunks checksum is verified, existence of a data chunk is verified, first chunk is checked for header, last chunk is checked for ending. Things not checked for are: validity of values within a chunk, multiple header chunks, noncontiguous data chunks, end chunk before actual eof. This proce- dure can take lots of time. Possible return values: OK File is a valid PNG file. SIG no/broken PNG signature. BADLEN corrupt chunk length. EOF premature end of file. NOHDR missing header chunk. CKSUM crc mismatch. NODATA missing data chunk(s). NOEND missing end marker. ::png::isPNG file Returns a boolean value indicating if the file file starts with a PNG signature. This is a much faster and less intensive check than ::png::validate as it does not check if the PNG data is valid. ::png::imageInfo file Returns a dictionary with keys width, height, depth, color, compression, filter, and interlace. The values are the associated prop- erties of the PNG image in file. Throws an error if file is not a PNG image, or if the checksum of the header is invalid. For information on interpreting the values for the returned properties see http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html. ::png::getTimestamp file Returns the epoch time if a timestamp chunk is found in the PNG image contained in the file, otherwise returns the empty string. Does not attempt to verify the checksum of the timestamp chunk. Throws an error if the file is not a valid PNG image. ::png::setTimestamp file time Writes a new timestamp to the file, either replacing the old timestamp, or adding one just before the data chunks if there was no previous timestamp. time is the new time in the gmt epoch format. Throws an error if file is not a valid PNG image. ::png::getComments file Currently supports only uncompressed comments. Does not attempt to verify the checksums of the comment chunks. Returns a list where each element is a comment. Each comment is itself a list. The list for a plain text comment consists of 2 elements: the human read- able keyword, and the text data. A unicode (international) comment consists of 4 elements: the human readable keyword, the language identifier, the translated keyword, and the unicode text data. Throws an error if file is not a valid PNG image. ::png::removeComments file Removes all comments from the PNG image in file. Beware - This uses memory equal to the file size minus comments, to hold the inter- mediate result. Throws an error if file is not a valid PNG image. ::png::addComment file keyword text Adds a plain text comment to the PNG image in file, just before the first data chunk. Will throw an error if no data chunk is found. keyword has to be less than 80 characters long to conform to the PNG specification. ::png::addComment file keyword lang keyword2 text Adds a unicode (international) comment to the PNG image in file, just before the first data chunk. Will throw an error if no data chunk is found. keyword has to be less than 80 characters long to conform to the PNG specification. keyword2 is the translated key- word, in the language specified by the language identifier lang. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category png of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
comment, image, png, timestamp COPYRIGHT
Copyright (c) 2004, Code: Aaron Faupell <afaupell@users.sourceforge.net> Copyright (c) 2004, Doc: Andreas Kupries <andreas_kupries@users.sourceforge.net> png 0.1.2 png(n)
All times are GMT -4. The time now is 12:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy