02-26-2008
Is there a way other than using sed command?
Hi,
I have NULL characters at the beginning of each line in the file which are necessary as i have to process this file later.
I used the sed command suggested above. It removes the last ^Z. It also removes NULL characters present at the beginning of each line in my file.(This is a dos file that i am processing)
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi
i want to delete a particular character in file.
example
file name:abcsample
abc=bbbqw3/
hidh=ajjqiwio4/
xyx=hakjp/
........../
......./
i want to delete that special character (/) in abcsample file.please give the required commands for my requirement.
thank you (3 Replies)
Discussion started by: srivsn
3 Replies
2. Shell Programming and Scripting
hi
i want to delete a particular character in file.
example
file name:abcsample
abc=bbbqw3/
hidh=ajjqiwio4/
xyx=hakjp/
........../
......./
i want to delete that special character (/) in abcsample file Permnently.please give the required commands for my requirement.
required... (1 Reply)
Discussion started by: srivsn
1 Replies
3. Shell Programming and Scripting
I am having a file which has data like this:-
1,2,3,4,5,
But I need to remove the last comma from this file. So the data should be like
1,2,3,4,5
The command I tried was
temp=`cat ${FileName}.txt`
len=`awk '{print length($0)}' ${FileName}.txt`
len=`expr $len - 1`
... (12 Replies)
Discussion started by: rony_daniel
12 Replies
4. Shell Programming and Scripting
I would like to remove characters from column 7 so that from an input file looking like this:
>HWI-EAS422_12:4:1:69:89 GGTTTAAATATTGCACAAAAGGTATAGAGCGT U0 1 0 0 ref_chr8.fa 6527777 F DD
I get something like that in an output file:
... (13 Replies)
Discussion started by: matlavmac
13 Replies
5. Windows & DOS: Issues & Discussions
Hi
I want to replace first existence of the character
code I m using is
for /f "tokens=* delims= " %%a in (test2.csv) do (
set str=%%a
echo !str::=,! >> test3.csv
)
However it is replacing all the ':' whereas I want to replace first ':' by ',' and leave rest of the ':' as it is.
... (0 Replies)
Discussion started by: dashing201
0 Replies
6. UNIX for Dummies Questions & Answers
I have a file with lots of unnecessary double quotes ("). I tried to remove them but not successful.
Please assist. Thanks! (3 Replies)
Discussion started by: onlinelearner02
3 Replies
7. Shell Programming and Scripting
Hi there,
A total sed noob here. Is there a way using sed to delete everything before a character AND after another character on each line in a file? The deletion should also delete the indicating characters(here: an opening and a closing parenthesis).
The original file would look like... (3 Replies)
Discussion started by: bnbsd
3 Replies
8. Shell Programming and Scripting
Hi All,
I want to keep the name of the songs with their respective extensions only.
Sample Code
========
03 Choti choti gaiya choti choti gaval.mp3
03---Brazil Dhol.mp3
03 PAYALIYA .mp3
04 - Isq Risk .mp3
04%20-%20Oh%20My%20Love(wapking.in).mp3
08 - A2 - Aasan Nahin Yahan .mp3
AE... (3 Replies)
Discussion started by: Pramod_009
3 Replies
9. Shell Programming and Scripting
I will appreciate if you help me here in this script in Solaris Enviroment.
Scenario:
i have 2 files :
1) /tmp/TRANSACTIONS_DAILY_20180730.txt:
201807300000000004
201807300000000005
201807300000000006
201807300000000007
201807300000000008
2)... (10 Replies)
Discussion started by: teokon90
10 Replies
LEARN ABOUT DEBIAN
strltrim
STRLTRIM(3pub) C Programmer's Manual STRLTRIM(3pub)
NAME
strltrim - remove leading whitespace from string
SYNOPSIS
#include <publib.h>
char *strltrim(char *s);
DESCRIPTION
strltrim removes all leading whitespace characters from the beginning of a string, by moving everything starting from the first non-white-
space character to the beginning of the string. As whitespace is counted everything for which isspace(3) returns true.
RETURN VALUE
strltrim returns its argument.
EXAMPLE
To remove all indentation from all lines in a program, you might do the following:
#include <publib.h>
int main(void) {
char line[512];
while (fgets(line, sizeof(line), stdio) != NULL) {
strltrim(line);
printf("%s", line);
}
return 0;
}
SEE ALSO
publib(3), strrtrim(3), strtrim(3), isspace(3)
AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual STRLTRIM(3pub)