php - Extract ZIP's contents on screen but avoid extra information except of the file names -
i looking command print contents of archive (including sub-folders , it's files) without extracting actual archive on disk, on screen.
i achieve using other questions , answers site, , here command:
unzip -l test.zip | awk '/-----/ {p = ++p % 2; next} p {print $nf}'
the output:
0 04-11-2009 13:43 jodconverter-webapp-2.2.2/ 1815 04-11-2009 13:43 jodconverter-webapp-2.2.2/readme.txt 0 04-11-2009 13:43 jodconverter-webapp-2.2.2/src/ 5349 04-11-2009 13:42 jodconverter-webapp-2.2.2/src/jodconverter-webapp-2.2.2-sources.jar 26436 04-11-2009 13:43 jodconverter-webapp-2.2.2/license.txt 3819 04-11-2009 13:43 jodconverter-webapp-2.2.2/changelog.txt 3314202 04-11-2009 13:42 jodconverter-webapp-2.2.2/jodconverter-webapp-2.2.2.war
as can see output 1 line, , includes information don't need.
i want output of kind:
jodconverter-webapp-2.2.2/ jodconverter-webapp-2.2.2/readme.txt jodconverter-webapp-2.2.2/src/ jodconverter-webapp-2.2.2/src/jodconverter-webapp-2.2.2-sources.jar . . .
so not want output file names (and full path) , avoid other information time
permissions
, on, want use break-line
distinguish different files.
keep in mind command run on php file contents of file, don't know if can use <br>
break lines.
is possible single command?
well, can't think command return output need, may else can know more.
what in case split line array , play until want.
you have find pattern work cases. brief on command's output came following decisions:
- you splitting line using separator space (i.e explode() )
- the pattern can see there exist time of form
xx:xx
before actual file/directory ! can check if current line valid 24-based time using regular expression means if case , in$i
position of array$i+1
looking for, , therefore can copy new array. - repeat
i think bit pain, @ least solution.
Comments
Post a Comment