windows - How to delete Line feed on my lines -
i come ask help. have document created automatically. result of sql query.
an example of line line feed. word see that
"2k45.10 new";"arc ca 125 control";"4";"0";"8 640"; "2k45.23 new";"arc ca 125 reagent 400 tests ";"4";"0";"103 777" "2k45.28 new";"arc ca 125 reagent 100 test ";"4";"0";"27 113" "2k46.01";"arc anti tg calibrator ";"4";"0";"11 626" "2k46.10";"arc anti tg control";"4";"0";"8 483" "2k46.25";"arc anti tg rgt 100 test ";"4";"0";"26 872"
if open nopad++
"2k45.10 new";"arc ca 125 control";"4";"0";"8 640";"boite";"";"taxe 39% cd 38220000000" "2k45.23 new";"arc ca 125 reagent 400 tests ";"4";"0";"103 777" "2k45.28 new";"arc ca 125 reagent 100 test ";"4";"0";"27 113" "2k46.01";"arc anti tg calibrator ";"4";"0";"11 626" "2k46.10";"arc anti tg control";"4";"0";"8 483" "2k46.25";"arc anti tg rgt 100 test ";"4";"0";"26 872"
the problem in lines, there line feed , when run script, there or there of line feed me here cut line. below script use.
@echo off & cls set "$c=1" setlocal enabledelayedexpansion (for /f "delims=" %%a in (input.txt) ( if !$c!==1 ( set $l=%%a set /a $c+=1 ) else ( echo !$l!%%a set "$c=1" ) ))>sortie.txt
and result is
"2k45.23 new";"arc ca 125 reagent 400 tests ";"4";"0";"103 777" "2k45.28 new";"arc ca 125 reagent 100 test ";"4";"0";"30 652"; "2k46.01" ;"arc anti tg calibrator ";"4";"0";"11 626" "2k46.10" ;"arc anti tg control";"4";"0";"8 483" "2k46.25";"arc anti tg rgt 100 test ";"4";"0";"26 872";"2k47.01";"arc anti tpo calibrator
i don't understand why, lines without lf, there more crlf
thank you bring me.
@echo off setlocal enabledelayedexpansion set "sourcedir=u:\sourcedir" set "filename1=%sourcedir%\q35165390.txt" set "$c=1" /f "usebackqdelims=" %%a in ("%filename1%") ( if !$c!==1 ( set $l=%%a set /a $c+=1 ) else ( echo !$l!%%a set "$c=1" ) ) echo ============== set "$c=" /f "usebackqdelims=" %%a in ("%filename1%") ( if defined $c (echo !line!%%a&set "$c=" ) else ( set "line=%%a" set "line=!line:"=_#_!" if "!line:~-3!"=="_#_" (echo %%a) else (set "$c=1"&set "line=%%a") ) ) goto :eof
the first part of batch code couple of small changes read data file named suit system.
given data show notepad++
version, result of running code is:
"2k45.10 new";"arc ca 125 control";"4";"0";"8 640";"boite";"";"taxe 39% cd 38220000000""2k45.23 new";"arc ca 125 reagent 400 tests ";"4";"0";"103 777""2k45.28 new";"arc ca 125 reagent 100 test ";"4";"0";"27 113""2k46.01";"arc anti tg calibrator ";"4";"0";"11 626""2k46.10";"arc anti tg control";"4";"0";"8 483" "2k46.25";"arc anti tg rgt 100 test ";"4";"0";"26 872" ============== "2k45.10 new";"arc ca 125 control";"4";"0";"8 640";"boite";"";"taxe 39% cd 38220000000" "2k45.23 new";"arc ca 125 reagent 400 tests ";"4";"0";"103 777" "2k45.28 new";"arc ca 125 reagent 100 test ";"4";"0";"27 113" "2k46.01";"arc anti tg calibrator ";"4";"0";"11 626" "2k46.10";"arc anti tg control";"4";"0";"8 483" "2k46.25";"arc anti tg rgt 100 test ";"4";"0";"26 872"
which means data seem contain characters interfering processing.
note word
version not include "boite";"";"taxe 39% cd 38220000000"
instance.
but output code not match output code (and output misses entire ...boite...
line.)
so - somewhere getting word
, notepad++
interpreting same data differently.
i use editplus
, allows me see actual hex-codes in file. perhaps if examine file hex-editor, true file contents revealed.
Comments
Post a Comment