9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Input eg:
Ouput Expected.
The #rd line had the unexpted new line, which need to be replaced with space.
I was planing to go with checking the length of each line using awk and if the length is less than the defeined limit, (12 in above case) will replace the newline with space.
... (5 Replies)
Discussion started by: deepakwins
5 Replies
2. UNIX for Dummies Questions & Answers
I have a file ABC.DAT with 2 columns avaialble
Data format :
XYZ!$#$!120
XXZ!$#$!1000
YYZ!$#$!104
While running the following code :
FILE_COUNTER=1;
RECORD_CN_FILE_COUNT=$((`wc -l ABC.DAT| cut -f1 -d' '`));
while
do
FILE_NAME=`cat ABC.DAT.DAT| head -$FILE_COUNTER |tail -1 | awk -F... (1 Reply)
Discussion started by: Nikhil Gautam
1 Replies
3. Shell Programming and Scripting
Greetings!
Can we automate the process of removing a newline char from selected rows in a fixed width file using a shell?
Input is like
abcd1234
xyzd1234
abcd
a1b2c3d4
abcd1234
xyzd1234
xx
abcd1234
Expected output -
abcd1234xyzd1234
abcda1b2c3d4abcd1234xyzd1234
xxabcd1234
... (3 Replies)
Discussion started by: mailme0205
3 Replies
4. UNIX for Dummies Questions & Answers
Greetings!
Can we automate the process of removing a newline char from selected rows in a fixed width file using a shell?
Input is like
abcd1234
xyzd1234
abcd
a1b2c3d4
abcd1234
xyzd1234
xx
abcd1234
Expected output -
abcd1234xyzd1234
abcda1b2c3d4abcd1234xyzd1234
xxabcd1234
... (2 Replies)
Discussion started by: mailme0205
2 Replies
5. Shell Programming and Scripting
Regard,
How can i cut the text by special char(|) around 100 byte
and write the other of the text at newline using Perl.
... (3 Replies)
Discussion started by: Shawn, Lee
3 Replies
6. Programming
Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially):
xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’:
xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’
The same error with all c++ constructors - gcc 4.4.4.
If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies
7. Shell Programming and Scripting
Hello,
Need help substituting a particular word in a file having a single line but no newline character at the end.
I was trying to use sed but it doesn't work probably because there is no newline char at the end of the line.
$ cat hlq_detail
/outputs/alvan23/PDFs/bills
$ cat... (5 Replies)
Discussion started by: Shan_u2005
5 Replies
8. Shell Programming and Scripting
Heeloo all,
A weird problem perhaps. May god save others from this problem.
I want to print each line from a variable.. the example below should make it clear.
smvar="Hello World1
Hello world 2
forgot there I guess"
for eachline in $smvar
echo $eachline
end
Whats for... (3 Replies)
Discussion started by: pavanlimo
3 Replies
9. Programming
Hello,
I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it:
char* getext(char *file)
{
char *extension;
int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies