Axis52401
asked on
How to automatically edit a text file to add a command space and then move the below line up to after the space
We use a scanner to scan bar codes when we get in inventory. The Inventory system is web bases so all we have to do is type in that number into a text box or several numbers and it will update the file with all the item. The problem is that the scanner outputs the serial numbers like this (below)
00020957000311
00020957000311
16139651541515
etc
When we put them into the browser to do it to enter multiple items we have to change it to
00020957000311, 00020957000311, 16139651541515...etc
Basically we have to take the list and hit comma space delete so they line up like that so the S/W can upload multiple serial numbers. The problem is this list can be 500 serial numbers long and ir rather tedious. Is there any sort of script or Macro that can do this from the list?
00020957000311
00020957000311
16139651541515
etc
When we put them into the browser to do it to enter multiple items we have to change it to
00020957000311, 00020957000311, 16139651541515...etc
Basically we have to take the list and hit comma space delete so they line up like that so the S/W can upload multiple serial numbers. The problem is this list can be 500 serial numbers long and ir rather tedious. Is there any sort of script or Macro that can do this from the list?
By macro, you can put your numbers in column A and run the attached code
sub concat
dim cl as range, strResult as string
for each cl in range(cells(1,1),cells(rows.count,1).end(xlup))
strresult=strresult & cl &","
next cl
strresult=left(strresult,len(strresult)-1)
cells(1,2)=strresult
end sub
If you want to do it in a BAt script, you can do the following:
@echo off
if exist "c:\temp\output.txt" del "c:\temp\output.txt"
for /F "tokens=*" %%A in ("c:\temp\input.txt") do (
echo.%%~A>>"c:\temp\output.txt"
)
~bp
ASKER
I was hoping there was some sort of Utility I could use, I'm bot much of a programer.
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oBda, wow, I was dozing when I created that, wasn't I !
ASKER
Thanks, that worked perfectly
Thomas