我正在尝试使用shell脚本命令压缩文件.我正在使用以下命令:
zip ./test/step1.zip $FILES
Run Code Online (Sandbox Code Playgroud)
其中$ FILES包含所有输入文件.但我收到的警告如下
zip warning: name not matched: myfile.dat
Run Code Online (Sandbox Code Playgroud)
还有一件事我发现文件夹中文件列表中最后的文件有上述警告,而且文件没有压缩.
任何人都可以解释我为什么会这样吗?我是shell脚本世界的新手.
我是perl中win32:ole模块的新手.我试图在命令提示符下逐行打印MS word表数据.但我只能打印表格的最后一行.你能帮我解决这个问题吗?提前致谢.
以下是我的代码:
#!/usr/bin/perl
use strict;
use warnings;
use File::Spec::Functions qw( catfile );
use Win32::OLE qw(in);
use Win32::OLE::Const 'Microsoft Word';
$Win32::OLE::Warn = 3;
my $word = get_word();
$word->{DisplayAlerts} = wdAlertsNone;
$word->{Visible} = 1;
my $doc = $word->{Documents}->Open('C:\\PerlScripts\\myTest.docx');
my $tables = $word->ActiveDocument->{'Tables'};
for my $table (in $tables)
{
my $tableText = $table->ConvertToText({ Separator => wdSeparateByTabs });
print "Table: ". $tableText->Text(). "\n";
}
$doc->Close(0);
sub get_word
{
my $word;
eval { $word = Win32::OLE->GetActiveObject('Word.Application');};
die "$@\n" if $@;
unless(defined $word)
{
$word …Run Code Online (Sandbox Code Playgroud) 我正进入(状态
错误405:不允许方法
MessageEnd.java:
package com.example.wordcount;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Path("/jersey")
public class MessageEnd {
@GET
@Path("/getvalue/{word}")
@Produces(MediaType.TEXT_PLAIN)
public Response sayHello(@PathParam("word") String word){
String output = " Count of word " + word;
return Response.status(200).entity(output).build();
}
@PUT
@Path("/sendvalue/{msg}")
@Consumes(MediaType.TEXT_PLAIN)
@Produces(MediaType.TEXT_PLAIN)
public Response sendMsg(@PathParam("msg") String msg){
String output = "Received message= " + msg;
return Response.status(200).entity(output).build();
}
}
Run Code Online (Sandbox Code Playgroud)
仅供参考,@GET工作正常.
我正在使用以下URI:
http://localhost:8080/message/jersey/sendvalue/hi
Run Code Online (Sandbox Code Playgroud) 我试图在java.util.date中转换字符串,但我有以下错误:
HelloWorld.java:10: error: incompatible types: Date cannot be converted to String
return FORMATTER.parse(date);
^
HelloWorld.java:16: error: incompatible types: String cannot be converted to Date
Date date = convertStringToDate("2015-08-03 09:19:00.000");
Run Code Online (Sandbox Code Playgroud)
我的代码如下:
import java.text.SimpleDateFormat;
import java.util.Date;
public class HelloWorld{
private static final SimpleDateFormat FORMATTER = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
public static String convertStringToDate(String date) {
if(date!=null){
return FORMATTER.parse(date);
}
return null;
}
public static void main(String []args){
Date date = convertStringToDate("2015-08-03 09:19:00.000");
System.out.println(date);
}
}
Run Code Online (Sandbox Code Playgroud)