Code: Select all
somefile.ext "title of the file with spaces A"
somefile2.ext "title of the file with spaces B"
Code: Select all
FOR /F "usebackq tokens=1*" %%a IN ("%listfile%") DO (
set "filename=%%~a"
set "filetitle=%%~b"
)
Code: Select all
somefile.ext "title of the file with spaces A"
somefile2.ext "title of the file with spaces B"
Code: Select all
FOR /F "usebackq tokens=1*" %%a IN ("%listfile%") DO (
set "filename=%%~a"
set "filetitle=%%~b"
)
Code: Select all
Loop, Read, list.txt
{
MsgBox, %A_LoopReadLine%
Count := 0
Loop, Parse, A_LoopReadLine, "
{
Count++
MsgBox, %A_LoopField%
If (Count = 2)
{
Break
}
}
}
Code: Select all
; place the data in an array:
Data := []
FileRead, Text, list.txt
loop, Parse, Text, `n, `r
{
RegExMatch(A_LoopField, "([^""]*)(.*)", Match)
Data.Push({filename: Trim(Match1), filetitle: Match2})
}
; display the array contents:
Output := ""
for Each, Item in Data
Output .= "File name: " Item.filename "`nFile title: " Item.filetitle "`n`n"
MsgBox, % Output
Code: Select all
RegExMatch(A_LoopField, "([^""]*)""(.*)""", Match)