ZTree.com  | ZEN  | About...  

 Index   Back

[Q] is there a way to preserve spaces by running a script?   [Q]

By: Ryan       
Date: Aug 21,2017 at 01:07
In Response to: [Q] is there a way to preserve spaces by running a script? (Nick Williams)

>your original post made no mention of "line input".
i try to post with many visual aids for the viewers and helpers, but sometimes, i have to cut out the flesh and leave the bones. but in this process... things get over-simplified and doesnt convey the message well.

>Even though I was confident that your use of "TOKENS=*" was the problem, I tested
>"DELIMS=" here, before posting. It works correctly, as you requested.
i dont know what to say, i overshot your messages, i interpreted it as "try delims" when my mind was already heavily rejecting the use of delims long ago for the case like this, so my mind set built with tokens=*. but i tried delims examples from websites again

FOR /F "tokens=1,2* delims=," %%%V IN (m:\1.txt) DO ECHO %%%V

FOR /F "usebackq tokens=1,2* delims=," %%%V IN (m:\1.txt) DO ECHO %%%V


because i didnt know how to get ascii symbol 13 or 20 delims, this was a failure but it worked for my simplified previous posted example where there were no ","'s in the text. so i went back to my orginal mind set.
FOR /F "TOKENS=*" %%%V IN ('TYPE %K1%') DO (
was my creation based on what i know, it didnt come from any websites, thinking that TYPE might do. it worked well when there were no spaces in front of lines.

"DELIMS=" i never thought of empty delims, when you said you tried it and it worked, why could he possibly!.... all of sudden, an empty delims was shinning.
It worked, and thanks for your help very much.

> sometimes a little pointer might help like... "try abc" "i think it
> worked before but i dont remember it well"
yes this can elliminate my goose chase, and i will not post the same content twice.
i need to know the upper limit, sometimes it is hard to find it in the internets

846 views      
Thread locked
 

Messages in this Thread

 
96,640 Postings in 12,231 Threads, 350 registered users, 53 users online (0 registered, 53 guests)
Index | Admin contact |   Forum Time: Apr 18, 2024 - 12:31 pm UTC  |  Hits:62,913,676  (8,100 Today )
RSS Feed