记事本+ +。我想在第一次" .jpeg"之后删除所有内容。在记事本++中。

时间:2015-05-05 19:00:07

标签: notepad++ notepad

2 个答案:

答案 0 :(得分:3)

输入:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/rootLinearLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:background="@android:color/white"
    android:visibility="visible">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white"
        android:gravity="top">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient's name:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="@string/placeholder_text"
            android:id="@+id/patientsNameTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            />
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient's gender:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="@string/placeholder_text"
            android:id="@+id/patientsGenderTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            />
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient&apos;s DOB:"
            style="@style/bodyText"
            android:id="@+id/patientsDOBTitle"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="@string/placeholder_text"
            android:id="@+id/patientsDOBTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            />
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient's telephone:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/patientsTelephoneTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        style="@style/horizontalLinearLayout"
        android:background="@android:color/white"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:gravity="top">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient's postcode:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/patientsPostcodeTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient's address:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/patientsAddressTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Reason for referral:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/referralReasonTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white"
        style="@style/verticalLinearLayout">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient presenting with:"
            style="@style/bodyText"
            android:layout_marginBottom="@dimen/very_small_vertical_spacing"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/additionalInfoTextView"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"
            android:gravity="left"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Details of allergies:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/allergiesTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Registered surgery:"
            style="@style/bodyText"
            android:id="@+id/registeredTextTitle"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/surgeryTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingBottom="@dimen/small_vertical_spacing"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@color/grey_light_expanded"
        android:paddingTop="@dimen/small_vertical_spacing"
        android:id="@+id/patientsBookingLocationHolder">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/patientsBookingLocationTextView"
            android:gravity="left"
            style="@style/boldBlueBodyText"
            android:text="@string/placeholder_text"
            />

    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"
          android:id="@+id/patientsBookingLocationHolderHR"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@color/grey_light_expanded">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Contact number:\n(at time of booking)"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/contactNumberTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@color/grey_light_expanded"
        android:id="@+id/patientRepHolder">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient's representative:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/representativeTextView"
            android:gravity="right"
            style="@style/blueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:layout_margin="0dp"
          android:id="@+id/patientRepHolderHR"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:id="@+id/ambulanceRequiredHolder"
        android:background="@color/grey_light_expanded">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Ambulance required:"
            style="@style/bodyText"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:id="@+id/ambulanceRequiredTextView"
            android:gravity="right"
            style="@style/boldBlueBodyText"
            android:text="@string/placeholder_text"/>
    </LinearLayout>
    <View style="@style/hr"
          android:id="@+id/ambulanceRequiredHolderHR"
          android:layout_margin="0dp"/>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:id="@+id/patientsLocationHolder"
        android:background="@color/grey_light_expanded">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient's location at time of booking:"
            style="@style/bodyText"/>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="Patient's name:"
            android:id="@+id/patientsLocationTextView"
            style="@style/blueBodyText"
            android:layout_marginTop="@dimen/small_vertical_spacing"/>
    </LinearLayout>

    <View style="@style/hr"
          android:id="@+id/patientsLocationHolderHR"
          android:layout_margin="0dp"/>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:gravity="top"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:background="@android:color/white">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text="I confirm that:"
            style="@style/bodyText"
            android:textStyle="bold"/>
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:text=""
            android:layout_marginTop="@dimen/small_vertical_spacing"
            android:gravity="left"
            style="@style/bodyText"
            android:textSize="12sp"
            android:id="@+id/confirmationText"/>
    </LinearLayout>
</LinearLayout>

以正则表达式模式查找和替换:
找到:http://img6a.flixcart.com//image/mobile/z/r/j/micromax-bling-q55-bling-limited-iifa-edition-400x400-imadfebcbg7yzrmh.jpeg,http://img5a.flixcart.com//image/mobile/z/r/j/micromax-bling-q55-bling-limited-iifa-edition-75x75-imadfebcbg7yzrmh.jpeg
替换为:^(.*?jpeg).*$

enter image description here

结果:

\1

说明:

http://img6a.flixcart.com//image/mobile/z/r/j/micromax-bling-q55-bling-limited-iifa-edition-400x400-imadfebcbg7yzrmh.jpeg

答案 1 :(得分:2)

以下是我要做的事情,使用macro

你有一千行格式

http://www.alice.com/bob.jpeg;http://www.wolf.com/rabbit.jpeg

你想变成

http://www.alice.com/bob.jpeg

删除&#34; .jpeg&#34;。

的第一个实例后的所有内容
  • 备份文件。
  • 在Notepad ++中打开文件(显然)。
  • 转到Macro -> Start recording菜单项。
  • Ctrl + f 进入Find对话框。
  • 确保设置为:
    • 仅匹配整个单词:未选中;
    • 匹配案例:未选中;
    • 环绕:未选中;
    • 搜索模式:&#39;正常&#39;;
    • 方向:向下。
  • 输入&#34; .jpeg&#34;然后按 Enter 。这将在光标后选择.jpeg的下一个实例。
  • Escape 。这将解雇&#34; Find&#34;窗口。
  • 。这将清除选择并在 .jpeg
  • 之后将光标移动到
  • Shift +结束。这将选择之后的其余部分 .jpeg
  • 删除删除选择。
  • 将光标移动到下一行的开头。
  • 转到Macro -> Stop recording菜单项。

此时,宏已设置,应该可以使用。

转到Macro -> Playback菜单项以在下一行测试它。

如果它按预期工作,请尝试Macro -> Run a macro multiple times菜单项并尝试运行几次(小心开始,比如五次)。

如果在这一点上,结果如您所愿,那么你就行了!在Run a macro multiple times菜单项中输入一个较大的数字以接近文件末尾,然后使用Playback项(或按 Ctrl + Shift + P )进行操作最后几个。