delphinelep
Programmer
I have this problem
here is my first file
Code:
1025#1025#N#N#1#100#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#1#150#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#1#200#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#250#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#300#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#350#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#600#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1026#1026#N#N#1#100#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1026#1026#N#N#1#150#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1026#1026#N#N#1#200#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1026#1026#N#N#1#250#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1026#1026#N#N#1#300#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1026#1026#N#N#1#350#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1028#1028#N#N#1#100#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1028#1028#N#N#1#150#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1028#1028#N#N#1#200#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1028#1028#N#N#1#250#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1028#1028#N#N#1#300#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1028#1028#N#N#1#350#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1028#1028#N#N#1#400#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#1#250#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#1#300#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#1#350#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#100#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#150#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#200#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#400#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#450#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#500#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
1025#1025#N#N#2#550#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
Here is what my program made
if field 1 contain 1025 then I replace it by 'XXXXXX'
Code:
cat -u ../LOG_ARCH/test.txt | awk -F'#' '{
# si le champ1 contient le numéro 1025
if ($1=='1025')
{
$1="XXXXXXX"
OFS="#"
print $0
}
}' > ../LOG_ARCH/test.txt
The problem is that my output file is truncate .
Code:
XXXXXXX#1025#N#N#1#100#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#1#150#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#1#200#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#250#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#300#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#350#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#600#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#1#250#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#1#300#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#1#350#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#100#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#150#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#200#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#400#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#450#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#1025#N#N#2#500#0#001#19755#12589#10000004#45712#AB#192121#terminal#test1#test2#test4#test5#test6#test7#test8#test9#test10#test34#test38
XXXXXXX#10
Why ? And how can I correct this problem
Thanks for your answers,